Antonio,
I think this : (click on wnd after you show the window at ttray )
#include "Fivewin.CH"
static oWnd, oTray, oIcon
function TESTIT()
local oIcon1
DEFINE ICON oIcon FILE "c:\work\fwh\icons\fivewin.ICO"
DEFINE ICON oIcon1 FILE "c:\work\fwh\icons\folder.ico"
DEFINE WINDOW oWnd TITLE "Icon Tray Class for FiveWin! from Jim Gale" ICON oIcon
ACTIVATE WINDOW oWnd ;
ON CLICK TestMeterTray() ;
ON INIT oTray := TTrayIcon():New( oWnd, oIcon, "Testing tray ...",;
{ || MsgInfo( "Left CLick" ) },;
{ | nRow, nCol | MenuTray( nRow, nCol, oTray ) } ) ;
VALID oTray:End() ;
ON RIGHT CLICK oTray:SetIcon( oIcon1, "Another" )
return NIL
function MenuTray( nRow, nCol, oTray )
local oMenu
MENU oMenu POPUP
MENUITEM "Show" ACTION oWnd:Show(), oWnd:SetFocus()
MENUITEM "Hide" ACTION oWnd:Hide()
SEPARATOR
MENUITEM "Close Application" ACTION oWnd:end()
ENDMENU
ACTIVATE POPUP oMenu AT nRow, nCol OF oTray:oWnd
return NIL
FUNCTION TestMeterTray()
LOCAL nTotal := 20
FOR nPos := 1 TO nTotal
MsgMeterTray(nPos, nTotal, "Enviando clientes...")
SysWait(0.1)
NEXT
MsgMeterTray(nPos, nTotal, "Enviados com êxito")
RETURN NIL
//----------------------------------------------------------------------------\\
FUNCTION MsgMeterTray(_nPos, _nTot, _cTit)
LOCAL nPorct, cMeter
nPorct := INT((100/_nTot) * _nPos)
cMeter := LEFT(REPLICATE("=", nPorct / 5)+REPLICATE("~", 20), 20)
cMeter := LEFT(cMeter,10)+STRZERO(nPorct,3)+"%"+RIGHT(cMeter,10)
ShowMsgTray("["+cMeter+"]", _cTit)
RETURN nil
*------------------------------------------------------------------------------*
FUNCTION ShowMsgTray(cMsg, cTit)
SysRefresh()
IF cMsg == NIL .OR. cTit == NIL
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, "", "")
Shell_NotifyIcon( 1, c )
ELSE
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, cMsg, cTit )
Shell_NotifyIcon( 0, @c )
Shell_NotifyIcon( 1, c )
ENDIF
oTray:Refresh()
RETURN NIL
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com