Bring Dialog to Top on System Tray App

Bring Dialog to Top on System Tray App

Postby byron.hopp » 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
byron.hopp
 
Posts: 347
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Bring Dialog to Top on System Tray App

Postby ukoenig » Wed Jan 29, 2020 9: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

Image

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: Select all  Expand view

// ---------- 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 14 guests