FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bring Dialog to Top on System Tray App
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Bring Dialog to Top on System Tray App
Posted: Tue Jan 28, 2020 11:50 PM

I have a system tray app, and I would like to bring the dialog to the front of the desktop.

I have tried oDlg:GoTop()
Tried BringWindowToTop( oDlg:hWnd )
oDlg:SetFocus()

None seem to work. Any ideas...

Byron ...

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Bring Dialog to Top on System Tray App
Posted: Wed Jan 29, 2020 09:55 AM
Byron Hopp,

I would like to bring the dialog to the front of the desktop.

I have tried oDlg:GoTop()
Tried BringWindowToTop( oDlg:hWnd )
oDlg:SetFocus()


ACTIVATE DIALOG oDlg CENTERED ;
ON INIT SETWINDOWPOS( oDlg:hWnd, -1, 0, 0, 0, 0, 3 )


A possible usage :
I added a switch to change from on top to taskbar to the installer
connected to the internet You can stay on top of a website or move to the taskbar on focus-change



If You want to switch between top and taskbar at runtime here is the needed little exe
Usage : WINEXEC( "RESTART Install.exe " + Str( oWnd:hWnd ), 0 )
( replace < install.exe > with Your program-name and change < oWnd:hWnd > to the used name )
http://www.pflegeplus.com/DOWNLOADS/Restart.exe

Code (fw): Select all Collapse
// ---------- Close ( position saved to INI )

@ 15, oWnd:nWidth - 45 BTNBMP oBtnClose ;
FILE  c_path1 + "Closew1.bmp", "", "", ;
        c_path1 + "Closew2.bmp" ;
FLAT NOBORDER NOROUND ACTION ( nWndTop := oWnd:nTop, nWndLeft := oWnd:nLeft, ;
         SAVE_INI(), oWnd:End() ) SIZE 24, 24  
oBtnClose:lTransparent := .T.
oBtnClose:cToolTip := { "Exit installer", "EXIT", 1, CLR_BLACK, 14089979 } 

@ 390, 305 RADIO oPRadio2 VAR nWndPos ITEMS "on TOP", "normal" OF oWnd SIZE 70, 30 PIXEL ;
ON CHANGE { ||  SAVE_INI(), WINEXEC( "RESTART Install.exe " + Str( oWnd:hWnd ), 0 ) } UPDATE  // close and restart
AEval( oPRadio2:aItems, { | oRad | oRad:lTransparent := .T., ;
          oRad:SetFont ( oFontSys ), ;
          oRad:nClrText := 0 } )

// windows or dialog
// moves on restart to the saved position from INI

ACTIVATE WINDOW oWnd ;
ON INIT ( oWnd:Move( nWndTop, nWndLeft, oWnd:nWidth, oWnd:nHeight, .F. ), ;
BACKGRD( oWnd, nBackgrd, nWColorB, nWGradpos, cWBrush ), ;
IIF( nWndPos = 1, SETWINDOWPOS( oWnd:hWnd, -1, 0, 0, 0, 0, 3 ), ;  // TOP
     SETWINDOWPOS( oWnd:hWnd, -3, 0, 0, 0, 0, 3 ) ), ; // TASKBAR
     SET_MENUE( oWnd ), ;
     DRAWROUND( oWnd ) )


regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion