WINDOW ON A SECOND MONITOR ?

Moderator: Rathinagiri

User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: WINDOW ON A SECOND MONITOR ?

Post by mol »

I've made little test with:
GetDesktopHeight() and GetDesktopWidth()
These functions always return parameters of first monitor - witdh=1280 and height=1024.
When I drag application to second monitor, these functions still return parameters of first monitor.

I've defined main window at 0,1281 and app runs on second screen. But - it still reports parameters (desktop width and heigth) from first - smaller display.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: WINDOW ON A SECOND MONITOR ?

Post by andyglezl »

Hola Mol

Como es tu configuracion para la salida de los monitores ?, porque siempre me lo despliega en el primero.
Solo aparece si yo lo muevo manualmente.
---------------------------------------------------------------------------------------------------------------------
Hello Mol

As your output settings for the monitors?, Because I always displays it in the first.
Displayed only when I move it manually.

2Moniores.jpg
2Moniores.jpg (171.82 KiB) Viewed 7482 times

Code: Select all

#include <hmg.ch>

Function Main()

	nAnch := GetDesktopWidth()
	nAlto := GetDesktopHeight()

	DEFINE WINDOW FORM_1 AT 0,1370 WIDTH 1024 HEIGHT 500 MAIN TITLE "PANTALLA 1" BACKCOLOR WHITE

		@ 10,10 LABEL L1 VALUE STR( nAnch ) + " / " + STR( nAlto ) WIDTH 200 HEIGHT 20 FONT "Verdana" SIZE 12
		@ 50,10 BUTTON B1 CAPTION '&Mon2' WIDTH 060 HEIGHT 25 FONT "Arial" SIZE 09 ACTION Monitor2() TOOLTIP "Despliga Monitor 2"
	
	END WINDOW
	CENTER WINDOW Form_1
	ACTIVATE WINDOW Form_1
Return Nil
Function Monitor2()

		DEFINE WINDOW FORM_2 AT 0,1500 WIDTH 1024 HEIGHT 500 TITLE "PANTALLA 2"  BACKCOLOR BLUE

			@ 10,10 LABEL L2 VALUE STR( nAnch ) + " / " + STR( nAlto ) WIDTH 200 HEIGHT 20 FONT "Verdana" SIZE 12
	
		END WINDOW
		CENTER WINDOW Form_2
		ACTIVATE WINDOW Form_2

Return Nil
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: WINDOW ON A SECOND MONITOR ?

Post by andyglezl »

Quitando la siguiente linea, lo despliega en el segundo monitor...
----------------------------------------------------------------------------------------
By removing the following line is displayed on the second monitor ...
CENTER WINDOW Form_1
2Moniores2.jpg
2Moniores2.jpg (134.82 KiB) Viewed 7480 times

YES !
2Moniores3.jpg
2Moniores3.jpg (117.31 KiB) Viewed 7480 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: WINDOW ON A SECOND MONITOR ?

Post by srvet_claudio »

See:

Code: Select all

#define SM_XVIRTUALSCREEN    76   // The coordinates for the left side of the virtual screen. The virtual screen is the bounding rectangle of all display monitors.

#define SM_YVIRTUALSCREEN    77   // The coordinates for the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors.

#define SM_CXVIRTUALSCREEN   78   // The width of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors.

#define SM_CYVIRTUALSCREEN   79   // The height of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors.

#define SM_CMONITORS         80   // The number of display monitors on a desktop.

nValue := GetSystemMetrics ( nIndex )
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: WINDOW ON A SECOND MONITOR ?

Post by andyglezl »

Gracias por la info Dr. Claudio
2Moniores4.jpg
2Moniores4.jpg (18.66 KiB) Viewed 7471 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

WINDOW ON A SECOND MONITOR ?

Post by Pablo César »

Que bueno !

Quien sabe: SABE !

Gracias Claudio por tus aportes !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply