Results 1 to 8 of 8

Thread: WOW!

  1. #1

    Thread Starter
    Addicted Member Xenonic_Rob's Avatar
    Join Date
    Jun 2000
    Location
    England, UK
    Posts
    213

    Exclamation

    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))

    Rob Wright
    E-mail: [email protected]
    Website: http://www.xenonic.com
    The First Member of Honeybee's Club
    Favourite words: Zugzwang and Empiric

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3

    Thread Starter
    Addicted Member Xenonic_Rob's Avatar
    Join Date
    Jun 2000
    Location
    England, UK
    Posts
    213
    What's the API calls?

    Rob Wright
    E-mail: [email protected]
    Website: http://www.xenonic.com
    The First Member of Honeybee's Club
    Favourite words: Zugzwang and Empiric

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    Smile 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

  5. #5

    Thread Starter
    Addicted Member Xenonic_Rob's Avatar
    Join Date
    Jun 2000
    Location
    England, UK
    Posts
    213
    Hey Parksie - thanks very much.

    Rob Wright
    E-mail: [email protected]
    Website: http://www.xenonic.com
    The First Member of Honeybee's Club
    Favourite words: Zugzwang and Empiric

  6. #6
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    GetDC(0) would also do it.

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  8. #8
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    I'll remember that!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width