Page 1 of 1

How to control run out EXE into B Monitor

PostPosted: Wed Dec 12, 2018 3:55 am
by richard-service
Hi
I have Extended screen include two Monitor. Just call A Monitor and B Monitor.
I run my App and display into A Monitor.
My App call out EXE and want to dispaly this out EXE into B Monitor.
FWH any function or Windows API support it?

Re: How to control run out EXE into B Monitor

PostPosted: Wed Dec 12, 2018 5:05 am
by Antonio Linares

Re: How to control run out EXE into B Monitor

PostPosted: Wed Dec 12, 2018 8:20 am
by richard-service

Re: How to control run out EXE into B Monitor

PostPosted: Wed Dec 12, 2018 1:59 pm
by Otto
Hello Richard,
I save the coordinates of the main window and store these in an INI-file.
The user positions the window where he prefers and the next time the window opens exectly at this position.
With this coordinates the window opens on my right monitor.
Best regards
Otto


[FensterxWinhotelWINHOTEL]
Top= 189
Left= 2177
Height= 951
Width= 3590

Re: How to control run out EXE into B Monitor

PostPosted: Fri Dec 14, 2018 4:32 pm
by richard-service
Otto wrote:Hello Richard,
I save the coordinates of the main window and store these in an INI-file.
The user positions the window where he prefers and the next time the window opens exectly at this position.
With this coordinates the window opens on my right monitor.
Best regards
Otto


[FensterxWinhotelWINHOTEL]
Top= 189
Left= 2177
Height= 951
Width= 3590


Hi Otto,

Thanks for your solution. I will try it later.

Re: How to control run out EXE into B Monitor

PostPosted: Fri Dec 14, 2018 7:57 pm
by Natter
How do I know the resolution of the monitor I'm moving my window to ? If the monitors have different resolutions then I will need to resize the app window

Re: How to control run out EXE into B Monitor

PostPosted: Wed Dec 19, 2018 1:23 am
by richard-service
Otto wrote:Hello Richard,
I save the coordinates of the main window and store these in an INI-file.
The user positions the window where he prefers and the next time the window opens exectly at this position.
With this coordinates the window opens on my right monitor.
Best regards
Otto


[FensterxWinhotelWINHOTEL]
Top= 189
Left= 2177
Height= 951
Width= 3590


Hi Otto,

How to know B Monitor Resolution?
Because I know A Monitor Resolution. when run App to B Monitor, Only get A Monitor Resolution.
Thank you.

Re: How to control run out EXE into B Monitor

PostPosted: Wed Dec 19, 2018 9:08 am
by nageswaragunupudi
How to know B Monitor Resolution?

Please see

https://docs.microsoft.com/en-us/window ... y-monitors
https://docs.microsoft.com/en-us/window ... -functions

You need to develop your own functions for this.

Instead, FWH 18.12 is coming up with complete functionality for programming with multiple monitors.
Eg:
Code: Select all  Expand view

nMonitors := FW_ActiveMonitors()
oMonitor := FW_GetMonitor( 2 )
? oMonitor:nLeft, oMonitor:nWidth, etc.
// and a lot more
 


Right now, you can activate a window on second monitor in a simple way:
Code: Select all  Expand view

DEFINE WINDOW oWnd ...
ACTIVATE WINDOW oWnd ON INIT oWnd:Move( nil, oWnd:nLeft + ScreenWidth(), nil, nil, .t. )
 


A simple way to know the width of the second monitor is
Code: Select all  Expand view

nWidth2 := GetSysMetrics( 78 ) - ScreenWidth()
? GetSysMetrics( 79 ) // --> Maximum of the heights of 1st and 2nd monitors
 

This works when you have only 2 monitors.