Screen Dimmer
Does anyone know the best way to dim the screen? What I have done now is to take all 24 system color values, save them, make a copy, and then decrease the color values for each of these system colors and call SetSysColors().
It works, but it is very slow, as messages are sent to all the myriad of windows and for each dimming stage, there is a bunch of flashings as the individual windows are repainted with theie new colors (I am not sure if it is the application that repaints in this case or the operating system). When one had direct access to the video hardware this feature could be done very fast and easily. Does anyone have a better approach than my clumbsy attempt?
[686 byte] By [
Gyannea] at [2007-11-18 1:32:13]

# 2 Re: Screen Dimmer
mwilliamsson,
I don't know what 'alpha blending' is. Its not mentioned in my win32 help file that came with my WATCOM compiler. It's obviously a new feature. Is this a new API function and do you know how it works (it is a direct hardware control, etc.)?
Also, I note there are more than 25 system colors defined now. My reference only has 25, but the title bar, menu bar, the maximize, minimize, and close boxes are not effected by one of these 25 colors. You would know how many system colors are defined now?
Its very convenient that the first 25 system colors are defined as 0 to 24 so it makes the dimming easy to write in terms of a loop.
Thanks
# 3 Re: Screen Dimmer
Alpha blending is not the new feature... It is implemented in Win2000 and Xp (maybe ME too, i don't know)...
Look into the MSDN at the functions SetLayeredWindowAttribute and UpdateLayeredWindow and the style WS_EX_LAYERED...
It is standart Win32 API. And if your compiler doesn't know it, use GetProcAddress() function to retrieve addresses of these function and use them through pointers to them... They are all in user32.dll...
martin