Bayron...
Bayron wrote:Cuando muevo la ventana principal de la aplicacion a otro monitor que no sea el principal, cuando defino un dialogo,
te dejo un ejemplo probado en win7 (no se como el resultado en otras versiones)
oprime doble click en el simbolo {...} cuando abras el xbrowse
#include "fivewin.ch"
#define SM_CMONITORS 80
#define SM_XVIRTUALSCREEN 76
#define SM_YVIRTUALSCREEN 77
#define SM_CXVIRTUALSCREEN 78
#define SM_CYVIRTUALSCREEN 79
function main
local oWnd
local oBar
local aRect
define window oWnd title "Test multi monitor"
define buttonbar oBar of oWnd size 80, 30
define button prompt "Count" of oBar ;
action MsgInfo( "Total Visibles Monitors:" + Str( CountMonitors() ) )
define button prompt "Get Coors" of oBar;
action XBrowse( GetAllMonitorRect() )
define button prompt "Virtual Screen" of oBar;
action XBrowse( { GetSysMetrics( SM_YVIRTUALSCREEN ),;
GetSysMetrics( SM_YVIRTUALSCREEN ),;
GetSysMetrics( SM_CYVIRTUALSCREEN ),;
GetSysMetrics( SM_CXVIRTUALSCREEN ) } )
define button prompt "Move Next" of oBar;
action ( aRect := GetMonitorRect( 2 ), oWnd:Move( aRect[ 1 ], aRect[ 2 ] ) )
define button prompt "Move Prev" of oBar;
action ( aRect := GetMonitorRect( 1 ), oWnd:Move( aRect[ 1 ], aRect[ 2 ] ) )
define button prompt "All Window" of oBar;
action (oWnd:Move( GetSysMetrics( SM_YVIRTUALSCREEN ),;
GetSysMetrics( SM_YVIRTUALSCREEN ),;
GetSysMetrics( SM_CXVIRTUALSCREEN ),;
GetSysMetrics( SM_CYVIRTUALSCREEN ), .T. ) )
activate window oWnd
return nil
function CountMonitors()
return GetSysMetrics( SM_CMONITORS )
function GetAllMonitorRect()
local nTotalMon
local n
local aRect
local aMonitors := {}
if ( nTotalMon := CountMonitors() ) > 1
aRect = GetWndRect( GetDesktopWindow() )
AAdd( aMonitors, { 1, aRect } )
for n = 2 to nTotalMon
aRect = GetRectNextMonitor( aRect )
AAdd( aMonitors, { n, aRect } )
next
endif
return aMonitors
function GetMonitorRect( nMon )
local nTotalMon
local n
local aRect
local aMonitors := {}
aRect = GetWndRect( GetDesktopWindow() )
if ( nTotalMon := CountMonitors() ) >= nMon
for n = 2 to nMon
aRect = GetRectNextMonitor( aRect )
next
endif
return aRect
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( GETRECTNEXTMONITOR )
{
POINT pt;
HMONITOR hMon;
MONITORINFO pmi;
pmi.cbSize = sizeof( MONITORINFO );
pt.x = hb_parvnl( 1, 4 ) + 1;
pt.y = hb_parvnl( 1, 1 );
hMon = MonitorFromPoint( pt, MONITOR_DEFAULTTONULL );
if( hMon != NULL )
{
if( GetMonitorInfo( hMon, &pmi ) )
{
hb_reta( 4 );
hb_storvni( pmi.rcMonitor.top, -1, 1 );
hb_storvni( pmi.rcMonitor.left, -1, 2 );
hb_storvni( pmi.rcMonitor.bottom, -1, 3 );
hb_storvni( pmi.rcMonitor.right, -1, 4 );
}
}else
hb_retni( 0 );
}
#pragma ENDDUMP