WINDOW ON A SECOND MONITOR ?

Moderator: Rathinagiri

User avatar
mol
Posts: 2856
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 126 times
Been thanked: 65 times
Contact:

Re: WINDOW ON A SECOND MONITOR ?

Post by mol » Wed Jun 24, 2015 5:53 am

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: 848
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 7 times
Been thanked: 24 times
Contact:

Post by andyglezl » Wed Jun 24, 2015 9:38 pm

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 583 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: 848
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 7 times
Been thanked: 24 times
Contact:

Post by andyglezl » Wed Jun 24, 2015 9:57 pm

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

YES !
2Moniores3.jpg
2Moniores3.jpg (117.31 KiB) Viewed 581 times
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
srvet_claudio
Posts: 1953
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 31 times
Been thanked: 120 times
Contact:

Post by srvet_claudio » Wed Jun 24, 2015 11:04 pm

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: 848
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 7 times
Been thanked: 24 times
Contact:

Post by andyglezl » Thu Jun 25, 2015 12:03 am

Gracias por la info Dr. Claudio
2Moniores4.jpg
2Moniores4.jpg (18.66 KiB) Viewed 572 times
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 177 times

Post by Pablo César » Thu Jun 25, 2015 12:12 am

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