Page 2 of 2

Re: WINDOW ON A SECOND MONITOR ?

Posted: Wed Jun 24, 2015 5:53 am
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.

Re: WINDOW ON A SECOND MONITOR ?

Posted: Wed Jun 24, 2015 9:38 pm
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 2126 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

Re: WINDOW ON A SECOND MONITOR ?

Posted: Wed Jun 24, 2015 9:57 pm
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 2124 times

YES !
2Moniores3.jpg
2Moniores3.jpg (117.31 KiB) Viewed 2124 times

Re: WINDOW ON A SECOND MONITOR ?

Posted: Wed Jun 24, 2015 11:04 pm
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 )

Re: WINDOW ON A SECOND MONITOR ?

Posted: Thu Jun 25, 2015 12:03 am
by andyglezl
Gracias por la info Dr. Claudio
2Moniores4.jpg
2Moniores4.jpg (18.66 KiB) Viewed 2115 times

WINDOW ON A SECOND MONITOR ?

Posted: Thu Jun 25, 2015 12:12 am
by Pablo C├ęsar
Que bueno !

Quien sabe: SABE !

Gracias Claudio por tus aportes !