Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dual Monitor Support
Message
From
20/05/2005 19:35:41
 
 
To
18/05/2005 07:40:58
Graham Trott
Hamilton Pc Repair
Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01015265
Message ID:
01016403
Views:
12
>Is there a way to maximize a second form on the secondary monitor or to place a form on the secondary monitor while a form is running on the primary monitor.
>
>Thanks for any help

Start with this:
CLEAR

DECLARE INTEGER GetSystemMetrics IN user32.dll	INTEGER nIndex

#DEFINE SM_CMONITORS 80
#define SM_CXSCREEN  0
#define SM_CYSCREEN  1

#define SM_XVIRTUALSCREEN  76
#define SM_YVIRTUALSCREEN  77

#define SM_CXVIRTUALSCREEN  78
#define SM_CYVIRTUALSCREEN  79

? "Monitors  ",GetSystemMetrics(SM_CMONITORS)

* with aligns monitors

? "Primary width,height ",GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN)

? "Primary  width,height ",SYSMETRIC(1),SYSMETRIC(2) && this is bad

* 
? "Virtual width,height  ",GetSystemMetrics(SM_CXVIRTUALSCREEN),GetSystemMetrics(SM_CYVIRTUALSCREEN)

* Then
IF	    GetSystemMetrics(SM_CMONITORS)=2 ;
	AND GetSystemMetrics(SM_XVIRTUALSCREEN)=0;
	AND GetSystemMetrics(SM_YVIRTUALSCREEN)=0

	PUBLIC SOMEWINDOW
	SOMEWINDOW = CREATEOBJECT("SOMEWINDOW")
	SOMEWINDOW.LEFT = GetSystemMetrics(SM_CXSCREEN)+1

*	SOMEWINDOW.AUTOCENTER = .T.	&& VFP DON'T SUPPORT DUAL MONITORS HERE

	SOMEWINDOW.SHOW

ENDIF
RETURN

DEFINE CLASS SOMEWINDOW AS Form
	SHOWWINDOW = 2
	
	PROCEDURE  UNLOAD
		RELEASE SOMEWINDOW
ENDDEFINE

* More precise but complex with 

#DEFINE STRUCT_DWORD	0h00000000
#DEFINE STRUCT_LONG	0h00000000

#DEFINE STRUCT_RECT	STRUCT_LONG 	; && left	&&
  		+	STRUCT_LONG 	; && top	&&
		+	STRUCT_LONG 	; && right	&&
  		+	STRUCT_LONG 	  && bottom	&&


#DEFINE STRUCT_MONITORINFO		0h28000000	; && cbSize	&&
			+		STRUCT_RECT	; && rcMonitor	&&
			+		STRUCT_RECT	; && rcWork	&&
			+		STRUCT_DWORD	  && dwFlags	&&

#DEFINE STRUCT_MONITORINFOEX	0h28000000	; && cbSize	&&
		+		STRUCT_RECT	; && rcMonitor	&&
		+		STRUCT_RECT	; && rcWork	&&
		+		STRUCT_DWORD	; && dwFlags	&&
		+		STRUCT_TCHAR	  &&  szDevice[CCHDEVICENAME] &&

MONITORINFO = STRUCT_MONITORINFO

* .....
Previous
Reply
Map
View

Click here to load this message in the networking platform