Amigos, en un momento mas les muestro como manejo 2 pantallas
... es facil...
tomar en cuenta que Windows puede manjeras mas de 1 monitor, el 2do monitor tendra otras coordinadas,
Genero un xbrowse en otro dialogo para el segundo monitor, y al activarlo, debes calcular donde moverlo.....
oApp:n2monitor := TestMonitores()
ACTIVATE DIALOG oDlg2 NOWAIT ON INIT (oDlg2:Move(3, oApp:n2monitor + 4 ,,,.t.),
//------------------------------------------------------------------------------------------------------------------------------------------
Function TestMonitores()
#include "fivewin.ch"
#define SM_CMONITORS 80
#define SM_XVIRTUALSCREEN 76
#define SM_YVIRTUALSCREEN 77
#define SM_CXVIRTUALSCREEN 78
#define SM_CYVIRTUALSCREEN 79
local oWndMM
local oBar
local aRect
IF CountMonitors() > 1
Return( GetSysMetrics(0) + 1 )
EndIf
Return(0)
//------------------------------------------------****************************
//---------------------------------------------------------------------------------
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>
#ifdef __XHARBOUR__
long hb_parvnl( int iParam, int iIndex );
void hb_storvni( int iValue, int iParam, int iIndex );
#endif
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
//------------------------------------------------------------------------------