Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect Multiple Monitors
Message
 
 
To
25/02/2006 17:12:16
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01099227
Message ID:
01099279
Views:
29
This message has been marked as the solution to the initial question of the thread.
>How can you detect the presence of a second monitor? I am storing the position of a form (top-level) and then restoring it when it is subsequently created later. But I don't want to restore to an off-screen position if the form had previously been on a second monitor and is now not connected (possible if a laptop). SYSMETRIC(1) and SYSMETRIC(2) gives the screen size of the current screen but does not account for additional monitor.

You can use GetSystemMetrics WIN API function to get the # of monitors.
#DEFINE SM_XVIRTUALSCREEN 76
#DEFINE SM_YVIRTUALSCREEN 77
#DEFINE SM_CXVIRTUALSCREEN 78
#DEFINE SM_CYVIRTUALSCREEN 79
#DEFINE SM_CMONITORS 80
DECLARE INTEGER GetSystemMetrics IN user32 INTEGER nIndex
lnNonitors = GetSystemMetrics(SM_CMONITORS)
I also included some other constatnt related to the multi-monitor PC configuration. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemmetrics.asp for details
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform