Hey guys
Can I find the hDC of the whole screen rather than just a form or a command button or something. So I can impliment graphical API stuff on the WHOLE screen (let's say the distort effect (see the forum post))
Printable View
Hey guys
Can I find the hDC of the whole screen rather than just a form or a command button or something. So I can impliment graphical API stuff on the WHOLE screen (let's say the distort effect (see the forum post))
Try the GetDesktopWindow() function. This returns a window handle, so you'd need to use:
Code:Dim hWndDesk as Long
Dim hDCDesk as Long
hWndDesk = GetDesktopWindow
hDCDesk = GetDC(hWndDesk)
' ...api stuff...
ReleaseDC hWndDesk, hDCDesl
What's the API calls?
Code:Public Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
Public Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long
Public Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Hey Parksie - thanks very much.
GetDC(0) would also do it.
On Windows 98/2000, GetDC(0) returns a DC for the primary display monitor, which may not necessarily be the desktop.
I'll remember that!