-
October 3rd, 2012, 04:10 AM
#1
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...
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
October 3rd, 2012, 05:35 AM
#2
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.
-
October 3rd, 2012, 06:59 AM
#3
Re: GetDesktopWindow()
This Virtual Screen Coordinates essay can also help...
Victor Nijegorodov
-
October 3rd, 2012, 01:20 PM
#4
Re: GetDesktopWindow()
Thanks. I was able to fix it after reading those articles
"A problem well stated is a problem half solved.” - Charles F. Kettering
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|