|
-
Sep 2nd, 2000, 07:54 AM
#1
Thread Starter
Addicted Member
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))
-
Sep 2nd, 2000, 09:46 AM
#2
Monday Morning Lunatic
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
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 2nd, 2000, 10:10 AM
#3
Thread Starter
Addicted Member
-
Sep 2nd, 2000, 10:46 AM
#4
Monday Morning Lunatic
Sorry about that...
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
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 2nd, 2000, 11:28 AM
#5
Thread Starter
Addicted Member
Hey Parksie - thanks very much.
-
Sep 4th, 2000, 01:21 PM
#6
Fanatic Member
GetDC(0) would also do it.
-
Sep 4th, 2000, 01:29 PM
#7
Monday Morning Lunatic
On Windows 98/2000, GetDC(0) returns a DC for the primary display monitor, which may not necessarily be the desktop.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 5th, 2000, 12:29 PM
#8
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|