Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetDesktopWindow

132 views
Skip to first unread message

jm

unread,
Aug 7, 2000, 3:00:00 AM8/7/00
to

Hello,
I have been having trouble getting the desktop window using
GetDesktopWindow(). I want to get a screen shot of the entire window
and convert it to a bitmap image, which I will save to disk. Does
anyone know how to do this in just a few lines?

Here's where I have trouble:


MyFunction()
{
...
...

hwnd = GetDesktopWindow();
...
...
}


This is the error I get:
error C2440: '=' : cannot convert from 'class CWnd *' to 'struct
HWND__ *'

??? HOWEVER, this is a portion of the help page describing
"GetDesktopWindow()": (VC++ 6.0)
/*************************************************************************************************************/

The GetDesktopWindow function returns a handle to the desktop window.
The desktop window covers the entire screen. The desktop window is the
area on top of which all icons and other windows are painted.

HWND GetDesktopWindow(VOID)

Parameters.....
/*************************************************************************************************************/

Thanks for anyone's help......

Check Abdoul

unread,
Aug 7, 2000, 3:00:00 AM8/7/00
to
Hi...
You are calling the GetDesktopWindow() of CWnd base class. ( which
returns a pointer to CWnd ).

Instead what you wanted is the SDK's function. So qualify it with
the scope qualifier.

That is use ::GetDesktopWindow() instead of GetDesktopWindow()

Cheers
Check Abdoul
-----------------

"jm" <j...@none.com> wrote in message news:398EEFAF...@none.com...

Adrian O' Neill

unread,
Aug 7, 2000, 3:00:00 AM8/7/00
to

Hi,
Try GetDesktopWindow()->GetSafeHwnd();

Regards
--
Adrian O' Neill
Remove * in email address to reply

ass

unread,
Aug 22, 2000, 3:00:00 AM8/22/00
to
You should use "::GetDesktopWindow" to obtaine a HWND
or your hwnd must be of CWnd type.
0 new messages