Wednesday 15 April 2015

winapi - difference between GetDesktopWindow() and HWND_DESKTOP -



winapi - difference between GetDesktopWindow() and HWND_DESKTOP -

there's win32 api function, getdesktopwindow(), returns handle of desktop window.

and there's 1 - hwnd_desktop macro. couldn't find official info in msdn, it's found in winuser.h

#define hwnd_desktop ((hwnd)0)

so, what's difference between them?

hwnd_desktop used mapwindowrect() indicate using screen coordinates, as documented on msdn. you'll notice value equal null, listed there. i'm guessing hwnd_desktop came first.

of course, valid windows cannot null real, hwnd_desktop isn't handle of desktop window. while don't know of real things can it, proper way desktop window's handle function.

(for it's worth, illustration getdesktopwindow() uses returned handle position dialog box on screen. don't know if current preference utilize current monitor's work area instead...)

winapi

No comments:

Post a Comment