views:

390

answers:

2

Hi, I am trying to work out how to fade out or dim the Windows Desktop and then display a rectangular portion of the desktop normally. This is for a screen area capture program. You can see the precise effect I am after in Jing Fading the background in a Web page is also commonly done. Any tips/pointers/C++ source much appreciated. Google has not helped so far.

Thanks, Neville

+7  A: 
Clay Fowler
Thanks Clay, that makes sense but I'm struggling putting some sample code together to do it. I've got the transparent window but am stuck on where to go from here. It has been way too long since I've done any low level Windows graphics coding and it was never a strong point of mine.
nevf
Alright, I'll post a complete sample as another answer to this same question.
Clay Fowler
There's a complete example, nevf. Whew. Hope that helps.
Clay Fowler
Clay, thanks so much for that. Would you be able to send me the include files, or better still the complete project. You can e-mail me at [email protected]
nevf
Clay, don't worry about the other files as I have it working and it looks like it will do precisely what I want. Please e-mail me anyway.
nevf
A: 

The official way is with FadeWindow() api : Windows does that on Display Control Panel
You can see on http://tinyurl.com/yjy3ajr for standard code in C.

marcus
Thanks, but I can find any FadeWindow() api in Windows. I have searched VS2008 Help and MSDN. I did find an article at the site you linked to which used SetLayeredWindowAttributes() which is what Clay suggested above. This works well to fade a Window, but you can't then do any normal drawing on the Window as that is faded as well.
nevf
You can re-ask on the win32 group, as it's a classic question (the api must be called by ordinal number)
marcus