Hello,
I am writing a dialog based program that will take screenshots while the dialog is minimized. The trigger to take a screen shot is through WM_HOTKEY. I like to use the correct API to take the a window that is active due to user's mouse click while the dialog of the program is minimized. Now, I am using :
CWnd * pWnd = CWnd::GetActiveWindow() ;
while the window I like to take screenshot is active after mouse click. But when I debug it, pWnd is empty and giving me error. Any idea Please help me. Thanks.

How to find out the current window that is active due to your mouse click?????
Alexandru Matei
I believe GetForegroundWindow will be a better way to do this.
mojojo
Thanks, it worked. But I still have some more questions about measurement of my screenshots. I like to have the save the size to be (for example- 4in x 3in). Now, I am using CImage class and apply ::BitBlt () function where the parameters are only in terms of pixels.
So, it would be really helpful if I know the conversion between pixel and inch. Pleaseeee. advise me.
Thank a lot.
Maestro1988
See http://support.microsoft.com/default.aspx scid=kb;en-us;127152