FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Two monitors, show different windows
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Two monitors, show different windows
Posted: Fri Oct 04, 2024 12:55 PM
Hi fivewinners

I need to show some info in a second monitor, not to grab and place a window on mi 2nd monitor, but to work in the main one, and when need it show a window on the second one

Something like

Define Window .... of MONITOR1 algo asiii

or Activate Window on Paint GOTOMONITOR(2)


I can do mi work in mi main monitor, like a sale, and show photos, information on the second one, but controlled by me in the main one.

Any ideas.

From Chile
Adolfo
;-) 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Two monitors, show different windows
Posted: Fri Oct 04, 2024 11:02 PM
There are different ways.
This is the simplest.
Code (fw): Select all Collapse
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd  ON INIT WndCenterEx( oWnd:hWnd, 2 ) // 2 means second monitor
Another way
Code (fw): Select all Collapse
oMonitor2 := FW_GetMonitor( 2 )
DEFINE WINDOW oWnd FROM oMonitor2:Row(200), oMonitor2:Col(100) TO ;
   oMonitor2:Row(600),oMonitor2:Col(800) PIXEL
ACTIVATE WINDOW oWnd
Regards



G. N. Rao.

Hyderabad, India
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Two monitors, show different windows
Posted: Mon Oct 07, 2024 12:28 PM

Thanks a lot NAGES

Going to try inmediately

;-) 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
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Two monitors, show different windows
Posted: Mon Oct 07, 2024 01:00 PM

Nages

I get this error

Time from start: 0 hours 0 mins 7 secs

Error occurred at: 07/10/2024, 09:57:27

Error description: Error BASE/1004 Message not found: TMONITOR:NROW

Args:

 [   1] = O   TMONITOR

Stack Calls

===========

Called from: ../../../tobject.prg => __ERRRT_SBASE( 0 )

Called from: ../../../tobject.prg => TMONITOR:ERROR( 0 )

Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )

Called from: ../../../tobject.prg => TMONITOR:MSGNOTFOUND( 0 )

Called from: ../../../tobject.prg => TMONITOR:NROW( 0 )

Called from: .\source\function\getsysin.prg => (b)TMONITOR( 481 )

Called from: .\source\function\getsysin.prg => TMONITOR:ROW( 0 )

Called from

Local oMonitor2 := FW_GetMonitor( 2 )

DEFINE WINDOW oWnd2 FROM oMonitor2:Row(50), oMonitor2:Col(10) TO ;

oMonitor2:Row(700),oMonitor2:Col(900) PIXEL NOSYSMENU NOCAPTION

I'm using FWH 08/2024 MSVC

;-) 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Two monitors, show different windows
Posted: Mon Oct 07, 2024 01:10 PM
Not :nRow()
Use :Row()

Pease just copy and paste this code and try.
Code (fw): Select all Collapse
oMonitor2 := FW_GetMonitor( 2 )
DEFINE WINDOW oWnd FROM oMonitor2:Row(200), oMonitor2:Col(100) TO ;
   oMonitor2:Row(600),oMonitor2:Col(800) PIXEL
ACTIVATE WINDOW oWnd
This should work 100%.
After that you change the values as you like
Regards



G. N. Rao.

Hyderabad, India
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Two monitors, show different windows
Posted: Mon Oct 07, 2024 01:21 PM
NAGES

Called from...
Local oMonitor2 := FW_GetMonitor( 2 )

DEFINE WINDOW oWnd2 FROM oMonitor2:Row(50), oMonitor2:Col(10) TO ;
oMonitor2:Row(700),oMonitor2:Col(900) PIXEL NOSYSMENU NOCAPTION



Thats how I use it... ther is no NROW in mi code
;-) 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
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Two monitors, show different windows
Posted: Mon Oct 07, 2024 01:25 PM

Full code of my function

Function MuestraFoto(cTexto)

Local oBrush2

Local oWnd2

Local oMonitor2 := FW_GetMonitor( 2 )

DEFINE FONT oBold NAME 'Tahoma' SIZE 0, -320 BOLD

DEFINE BRUSH oBRush2 RESOURCE "LAYER" TILED

DEFINE WINDOW oWnd2 FROM oMonitor2:Row(50), oMonitor2:Col(10) TO ;

oMonitor2:Row(600),oMonitor2:Col(800) PIXEL NOSYSMENU NOCAPTION Brush oBrush2

@ nFil,nCol BITMAP oBmp FILENAME "test.png" OF oWnd2 NOBORDER PIXEL SIZE 800,800 ADJUST

oBmp:bPainted = { || SetBkMode( oBmp:hDC, 1 ),;

                    SetTextColor( obmp:hDC, CLR_WHITE ),;

                    oBold:Activate( oBmp:hDC ),;

                    TextOut( oBmp:hDC, 170, 30, cTexto ),;

                    oBold:DeActivate(oBmp:hDC) }

ACTIVATE WINDOW oWnd2

Return Nil

;-) 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Two monitors, show different windows
Posted: Mon Oct 07, 2024 04:54 PM
I am extremely sorry.
The error is due to a bug in our TMonitor class.
And also thanks for bringing it to our notice.

Can you please apply the fix I am going to provide here and try it again?

\fwh\source\function\getsysin.prg
Please locate these two lines: (481,482)
Code (fw): Select all Collapse
   METHOD Row( r )   INLINE ( ::nRow + r )
   METHOD Col( c )   INLINE ( ::nCol + c )
Please change them as:
Code (fw): Select all Collapse
   METHOD Row( r )   INLINE ( ::nTop  + r )
   METHOD Col( c )   INLINE ( ::nLeft + c )
I tested with this change and it works.
Can you help us by implementing this fix and testing again?
Regards



G. N. Rao.

Hyderabad, India
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Re: Two monitors, show different windows
Posted: Tue Oct 08, 2024 11:39 AM

Thanks Nages...

Works with no problems.

Thanks again

;-) 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Two monitors, show different windows
Posted: Wed Oct 09, 2024 03:01 AM
Please try this alternative approach also.
This may be simpler to code:
Code (fw): Select all Collapse
local oMonitor2   := FW_GetMonitor( 2 )
local oWnd2

DEFINE WINDOW oWnd2 FROM 50,10 TO 600,800 PIXEL

// create your controls

ACTIVATE WINDOW oWnd2 ON INIT oMonitor2:Move( oWnd2 )
Your feedback helps us.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Two monitors, show different windows
Posted: Thu Oct 10, 2024 08:16 AM
From the next version :
Code (fw): Select all Collapse
ACTIVATE WINDOW [<clauses,...] IN nMonitor/oMonitor
ACTIVATE DIALOG [<clauses,...] IN oWnd/nMonitor/oMonitor
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion