I want to know how i would accomplish the following: 1. Detect the current screen resolution, if it changes it will detect it. 2. Change the screen resolution 3. scan a specific area of the screen for a specified color thankyas
Posted on 2001-02-22 03:12:00 by Nayr
Hi, To Detect the current Resolution use GetSystemMetrics() it takes various parameters and returns information about the system, using SM_CXSCREEN gives the width SM_CYSCREEN gives the height. To find when the screen resolution has changed you must have a window. The window will receive WM_DISPLAYCHANGE when the screen resolution is changed, wParam has the bits per pixel in it, the lParam has two words, width in the high word, height in the low word. To Change the display resolution use ChangeDisplaySettigs, it's too lengthy to go into here, so take a look at the MS site. It's pretty straightforward. And finally, to find a pixel colour:- Call GetDesktopWindow() to get the Window Handle for the desktop Call GetDC, to get the device context. use GetPixel to return the RBG value of a pixel. hope this helps, if you have more specific questions I'm happy to answer them :-) umbongo.
Posted on 2001-02-22 04:54:00 by umbongo
an alternative way is to get the HIEGHT and WIDTH of your desktop . that's your resolution.
Posted on 2001-06-12 00:20:00 by NOP