-
GetDesktopWindow()
Code:
RECT desktop_rect;
GetWindowRect(GetDesktopWindow(), &desktop_rect);
My PC has two monitors - each of which is 1600x1200. Therefore I expected the above code to return a rectangle of 3200x1200 for my desktop window. However, it only returned 1600x1200. What have I done wrong... :confused:
-
Re: GetDesktopWindow()
This is by design with compatibility with older applications. It always returns the rectangle of the primary monitor. You need to call EnumDisplayMonitors() to get information about each monitor.
Have a look here: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx.
-
Re: GetDesktopWindow()
This Virtual Screen Coordinates essay can also help...
-
Re: GetDesktopWindow()
Thanks. I was able to fix it after reading those articles :thumb: