The code is a bit ugly, but ut works. You need four API
calls and the function below:
Global Const WM_HORZRES = 8
Global Const WM_VERTRES = 10
Declare Function WM_apiGetDesktopWindow Lib "user32"
Alias "GetDesktopWindow" () As Long
Declare Function WM_apiGetDC Lib "user32" Alias "GetDC"
(ByVal hwnd As Long) As Long
Declare Function WM_apiReleaseDC Lib "user32"
Alias "ReleaseDC" (ByVal hwnd As Long, ByVal hdc As Long)
As Long
Declare Function WM_apiGetDeviceCaps Lib "gdi32"
Alias "GetDeviceCaps" (ByVal hdc As Long, ByVal nIndex As
Long) As Long
Function GetDisplayWidth() As Integer
'* Returns the width of the display/desktop
Dim DisplayHeight As Integer
Dim DisplayWidth As Integer
Dim hDesktopWnd As Long
Dim hDCcaps As Long
Dim iRtn As Integer
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.