Results 1 to 5 of 5

Thread: Getting pixel help

  1. #1
    Guest

    Post

    I made an app that returns the RGB values of the pixel the mouse is over, but it only does this when the mouse is in the window itself, it wont do it on like the desktop. Why?

  2. #2
    Guest
    First you must use WindowFromPoint API to get the hWnd the window is over. Then from there, use GetWindowDC t get the DC and then use GetPixel to get the colour.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    OR directly use GetDesktopWindow and get the ´DC with GetDC
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Guest
    Ok i got it working now, but for some reason the edit boxes that show the values to the user blink alot, and the box contaning blue value doesnt even update itself, but the others do. Any ideas?

  5. #5
    Guest
    Now im really frustrated, i found a way around that problem, but now for some reason it wont update itself when its outside of the dialog. I have a start button. You press it and it turns to a stop button and it starts showing the values. If you move the cursor off the dialog, it stops. But while off the dialog, if you press the spacebar and trigger the stop button, it will show the values of the color of the pixel the mouse is resting over (outside the dialog). Again, any ideas?

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