Hola Foro,
Existe alguna manera de detectar cuantos monitores tiene instalados un ordenador, y si lo mostrado en esos monitores es lo mismo o se esta usando como Extension del Desktop???
DEFINE WINDOW oVent FROM 0, 0 TO (WndHeight( GetDesktopWindow()) - 30),;
(WndWidth( (GetDesktopWindow()) ) - 120)
Bayron wrote:Cuando le incluyo la opcion CENTERED, el dialogo se centra en el monitor principal y no sobre la Ventana Principal...
Alguien sabe como hacer para que centre sobre la Ventana Principal?????
ACTIVATE DIALOG oDlg ON INIT( ::Center( oWndMain ) )
Bayron wrote:Cuando muevo la ventana principal de la aplicacion a otro monitor que no sea el principal, cuando defino un dialogo,
#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
#ifdef __XHARBOUR__
long hb_parvnl( int iParam, int iIndex );
void hb_storvni( int iValue, int iParam, int iIndex );
#endif
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 80 guests