Two monitors, show different windows

Two monitors, show different windows

Postby Adolfo » 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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Two monitors, show different windows

Postby nageswaragunupudi » Fri Oct 04, 2024 11:02 pm

There are different ways.
This is the simplest.
Code: Select all  Expand view
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd  ON INIT WndCenterEx( oWnd:hWnd, 2 ) // 2 means second monitor


Another way
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Two monitors, show different windows

Postby Adolfo » 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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Two monitors, show different windows

Postby Adolfo » Mon Oct 07, 2024 1: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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Two monitors, show different windows

Postby nageswaragunupudi » Mon Oct 07, 2024 1:10 pm

Not :nRow()
Use :Row()

Pease just copy and paste this code and try.
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Two monitors, show different windows

Postby Adolfo » Mon Oct 07, 2024 1: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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Two monitors, show different windows

Postby Adolfo » Mon Oct 07, 2024 1: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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Two monitors, show different windows

Postby nageswaragunupudi » Mon Oct 07, 2024 4: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: Select all  Expand view
  METHOD Row( r )   INLINE ( ::nRow + r )
   METHOD Col( c )   INLINE ( ::nCol + c )


Please change them as:
Code: Select all  Expand view
  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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Two monitors, show different windows

Postby Adolfo » 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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Two monitors, show different windows

Postby nageswaragunupudi » Wed Oct 09, 2024 3:01 am

Please try this alternative approach also.
This may be simpler to code:
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Two monitors, show different windows

Postby nageswaragunupudi » Thu Oct 10, 2024 8:16 am

From the next version :

Code: Select all  Expand view
ACTIVATE WINDOW [<clauses,...] IN nMonitor/oMonitor
ACTIVATE DIALOG [<clauses,...] IN oWnd/nMonitor/oMonitor
 
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests