Results 1 to 3 of 3

Thread: DC & Getpixel issues... :/

  1. #1

    Thread Starter
    Member FaRd0wN's Avatar
    Join Date
    Mar 2002
    Posts
    32

    DC & Getpixel issues... :/

    I grabbed the hwnd...
    I got the window's DC...
    and now when i try to grab a pixel from the window it always fails and rets -1.

    I can't figure out why. but i did figure out that if the cursor is in the client area or passes through the client area and then i use the getpixel function it suceeds. I dont know how to get this to work. any suggestion... here is my code...

    Dim HDC As Long, LCOLOR As Long
    Dim aim As AIM_Windows
    Dim aimXY As POINTAPI
    aim = getAimWindows()
    '
    HDC = GetDC(aim.BuddyList)
    aimXY.x = 1000
    aimXY.y = 200
    'Call PostMessage(aim.BuddyList, WM_MOUSEFIRST, WM_LBUTTONDOWN, 0)
    LCOLOR = GetPixel(HDC, 19, 41)
    Call ReleaseDC(aim.BuddyList, HDC)
    If LCOLOR <> -1 Then frmMain.BackColor = LCOLOR
    frmMain.Caption = LCOLOR

    thanks

  2. #2
    Lively Member
    Join Date
    Nov 2001
    Location
    england
    Posts
    87
    http://www.vbforums.com/showthread.p...hreadid=144882

    Try looking at this thread. Might help

  3. #3

    Thread Starter
    Member FaRd0wN's Avatar
    Join Date
    Mar 2002
    Posts
    32
    hrm, no that won't do. i am dealing with an external hdc and like i said, if the cursor passed through the window getpixel will work for awhile then stops until the cursor passes through the window again.

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