Usar dos monitores, mostrar cosas diferentes

Usar dos monitores, mostrar cosas diferentes

Postby Adolfo » Fri Oct 04, 2024 12:38 am

Hola fivewinners

Como puedo hacer un proceso en un monitor, por ej, tener el browse de venta y al mismo tiempo mostrar en otro un resumen de la venta y quizas alguna foto del producto

Desde el primer monitor definir que se muestra en el segundo.

Yo tengo ambas funciones definidas pero funcionan solo en el monitor principal.

Cualquier sugerencia sera bienvenida.

Desde Chile
Saludos
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Usar dos monitores, mostrar cosas diferentes

Postby Danielmaximiliano » Fri Oct 04, 2024 2:12 am

Hola : viewtopic.php?f=3&t=40901&p=244894&hilit=monitor&sid=e6f0f91c756601dcbc3df2d2ebdf723c#p244894

en este hilo hay una repuesta para funciones de multiples monitores
Danielmaximiliano
 
Posts: 26
Joined: Tue Mar 20, 2012 11:06 pm

Re: Usar dos monitores, mostrar cosas diferentes

Postby Adolfo » Fri Oct 04, 2024 12:50 pm

Gracias Daniel

Ya habia visto eso.

Pero no encontre como asignar una Window a un monitor especifico.

Define Window .... of MONITOR1 algo asiii

o Activate Window on Paint GOTOMONITOR(2)


De esa forma realizo mi proceso normal en el monitor por defecto y los mensajes de informacion, fotos, resumenes al monitor alternativo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Usar dos monitores, mostrar cosas diferentes

Postby vilian » Fri Oct 04, 2024 1:42 pm

I'm also interested in this issue ;)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 982
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Usar dos monitores, mostrar cosas diferentes

Postby Willi Quintana » Fri Oct 04, 2024 4:03 pm

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.),

Image



//------------------------------------------------------------------------------------------------------------------------------------------
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
//------------------------------------------------------------------------------
Last edited by Willi Quintana on Fri Oct 04, 2024 5:38 pm, edited 2 times in total.
User avatar
Willi Quintana
 
Posts: 1022
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: Usar dos monitores, mostrar cosas diferentes

Postby acuellar » Fri Oct 04, 2024 5:32 pm

Estimado Adolfo

Intenta con éste código

Code: Select all  Expand view  RUN

#include "fivewin.ch"
*
function GetMonitorRect( nMon )
   local nTotalMon,n,aRect,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
*
Function CountMonitors()
return GetSysMetrics(80)
 
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1645
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Usar dos monitores, mostrar cosas diferentes

Postby nageswaragunupudi » Mon Oct 07, 2024 2:46 am

FWH provides multi-monitor support
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Usar dos monitores, mostrar cosas diferentes

Postby russimicro » Tue Oct 08, 2024 11:10 pm



FUNCTION SegundaPantalla(nVlrTot)

LOCAL J := 1, nNroFil := 0, nVlrArt := 0, cNomArt := 0 , oVlrTot
LOCAL nNroReg := LEC->( RECCOUNT() )
LOCAL nNroPan := 0
LOCAL aPanWin := FW_GetAllMonitors()
LOCAL nAncPan := 1024
LOCAL nAltPan := 680
LOCAL nAjuAn1 := 0.55
LOCAL nAjuAn2 := 0.60
LOCAL nAjuAn3 := 0.80
LOCAL oMonAct, oGrpDet , oFont
LOCAL nLinPan := 0 , vConBrw := {}
LOCal nAncExe := 1300

localizaRegistro("CAJ","cCodigoCaj",M->cCajIni)

try
nNroPan := VAL(getCampoRS("CAJ","cPreSerCaj",NIL))
if nNroPan == 0
nNroPan := 2
endif
catch
nNroPan := 2
end

FOR J := 1 TO LEN(aPanWin)
IF !( aPanWin[J]:LPRIMARY )
nAltPan := aPanWin[J]:NHEIGHT
nAncPan := aPanWin[J]:NWIDTH
ENDIF
NEXT

IF nAncPan < 1300
DEFINE FONT oFont NAME "Arial Narrow" SIZE 12, 40 BOLD
ELSE
DEFINE FONT oFont NAME "Arial Narrow" SIZE 14, 55 BOLD
ENDIF

nAltPan := nAltPan - 20

IF M->oDlgSegPan <> NIL
LEC->( DBGOBOTTOM() )
oBrwConPan:refresh()

IF nAncPan < 1300
@ nAltPan-80,nAncPan-225 SAY oVlrTot VAR nVlrTot PICT "999,999,999,999.99" SIZE 200,45 PIXEL FONT oFont OF oDlgSegPan CENTER ;
COLOR RGB(247,144,39),cColorFondo
ELSE
@ nAltPan-85,nAncPan*nAjuAn3 SAY oVlrTot VAR nVlrTot PICT "999,999,999,999.99" SIZE 250,60 PIXEL FONT oFont OF oDlgSegPan CENTER ;
COLOR RGB(247,144,39),cColorFondo

ENDIF

RETURN
ENDIF

AADD( vConBrw,{ "LEC->CNOMBREART", "DESCRIPCION" , REPL("X",24) , .F., IF(nAncPan<nAncExe,50,80) ,NIL,NIL,NIL,"I" } )
AADD( vConBrw,{ "TRANS(LEC->nDesTotMov,'999.99')", "DESCUENTO" , REPL("X",12) , .F., IF(nAncPan<nAncExe,14,18) ,NIL,NIL,NIL,"I" } )
AADD( vConBrw,{ "TRANS( LEC->NCANTIDMOV,'999,999,999.999' )", "CANTIDAD" , REPL("X",10) , .F., IF(nAncPan<nAncExe,12,20) ,NIL,NIL,NIL,"D" } )

AADD( vConBrw,{ "IF(LEC->NCANTIDMOV==0,'0',TRANS( nVlrNet(.F.,LEC->nCantidMov,LEC->nPreUniMov,LEC->nDesTotMov,"+;
"LEC->nDesctoMov,LEC->nImpIvaMov,LEC->nImpConMov)/LEC->NCANTIDMOV,'999,999,999,999.99' ) )" ,;
"VALOR UNIDAD" , REPL("X",16) , .F., IF(nAncPan<nAncExe,18,22) ,NIL,NIL,NIL,"D" } )

AADD( vConBrw,{ "TRANS( nVlrNet(.F.,LEC->nCantidMov,LEC->nPreUniMov,LEC->nDesTotMov,"+;
"LEC->nDesctoMov,LEC->nImpIvaMov,LEC->nImpConMov) ,'999,999,999,999.99' )",;
"VALOR TOTAL" , REPL("X",16) , .F., IF(nAncPan<nAncExe,18,22) ,NIL,NIL,NIL,"D" } )

LEC->( DBGOTOP() )

DEFINE DIALOG oDlgSegPan SIZE nAncPan,nAltPan PIXEL TRUEPIXEL TITLE "Estimado cliente favor verificar su compra"

@ 10,0 GROUP oGrpDet TO nAltPan-100, nAncPan-10 NOBORDER PIXEL


//RGB(114,192,70),RGB(0,112,188) CLR_BLUE

IF nAncPan < nAncExe

@ nAltPan-40,20 SAY "Software RUSSOFT ERP by RusSoft Ltda. Tel. # 316 5229528" ;
SIZE 600,30 PIXEL OF oDlgSegPan FONT M->oFonAc6 COLOR RGB(0,112,188) // RGB(247,144,39)

@ nAltPan-80,nAncPan-400 SAY "Valor Total : $ " SIZE 250,45 PIXEL OF oDlgSegPan FONT oFont COLOR RGB(114,192,70)
@ nAltPan-80,nAncPan-225 SAY oVlrTot VAR nVlrTot PICT "999,999,999,999.99" SIZE 200,45 PIXEL FONT oFont OF oDlgSegPan CENTER ;
COLOR RGB(247,144,39),cColorFondo
ELSE

@ nAltPan-40,20 SAY "Software RUSSOFT ERP by RusSoft Ltda. Tel. # 316 5229528" ;
SIZE 600,30 PIXEL OF oDlgSegPan FONT M->oFonAc6 COLOR RGB(0,112,188) // RGB(247,144,39)

//RGB(114,192,70),RGB(0,112,188) CLR_BLUE
//M->oFonAc6
@ nAltPan-85,nAncPan*nAjuAn2 SAY "Valor Total : $ " SIZE 250,60 PIXEL OF oDlgSegPan FONT oFont COLOR RGB(114,192,70)
@ nAltPan-85,nAncPan*nAjuAn3 SAY oVlrTot VAR nVlrTot PICT "999,999,999,999.99" SIZE 250,60 PIXEL FONT oFont OF oDlgSegPan CENTER ;
COLOR RGB(247,144,39),cColorFondo


ENDIF

ACTIVATE DIALOG oDlgSegPan NOMODAL ON INIT ( FW_GetMonitor( nNroPan ):Center( oDlgSegPan ) , creaBrowseLec(vConBrw,oGrpDet,nAncPan) )

MSGWAIT("Activando segunda pantalla","Russoft ERP",0.1)

RETURN


//*****************************************************************************


FUNCTION creaBrowseLec(vConBrw,oGrpDet,nAncPan)

M->oBrwConPan := BrowseConsulta( vConBrw, oGrpDet, "LEC",;
"",; // EliminaLec(oGetArt,oBrwConFw2)
"",;
"",;
NIL,1,NIL,IF(PARAMETRO(164),NIL,"COLOR MARRON") ;
,IF(PARAMETRO(164),NIL,"FONDO"),6, nAncPan)



RETURN .T.


//**************************************************************************************


russimicro
 
Posts: 262
Joined: Sun Jan 31, 2010 3:30 pm
Location: Bucaramanga - Colombia

Re: Usar dos monitores, mostrar cosas diferentes

Postby russimicro » Tue Oct 08, 2024 11:29 pm

russimicro
 
Posts: 262
Joined: Sun Jan 31, 2010 3:30 pm
Location: Bucaramanga - Colombia


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 126 guests