>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--