FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TTrayIcon
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
TTrayIcon
Posted: Fri Feb 27, 2026 04:01 PM

Hi to all,
I have a difference If I compile this program with an old version of FWH (2015) and the actual (december 2025)

Using the most recent version in the task bar appears the icon aof the program and in my opinion it shouldn't.

Using the 2015 version only in the icon tray appears the icon of this program and this is correct!

Can someone explain to me where I'm going wrong?

have a nice weeknd

#include "fivewin.ch"

FUNCTION MAIN()

LOCAL oWnd
LOCAL oTimer
LOCAL oTray
LOCAL oIcoMain

#define GCL_HICON -14

DEFINE ICON oIcoMain RESOURCE "TRAYICO"
DEFINE WINDOW oWnd TITLE "Salvaschermo" ICON oIcoMain FROM 1000,1000 TO 1000,1000

oWnd:bRButtonUp = { | nRow, nCol | Menu( oWnd, oTray, nRow, nCol, oTimer ) }

ACTIVATE WINDOW oWnd ON INIT oTray := TTrayIcon( oWnd )


oTray:End()

RETURN NIL


STATIC FUNCTION MENU( oWnd, oTray, nRow, nCol, oTimer )

LOCAL oMenu
LOCAL iMenu
LOCAL oIcon

DEFINE ICON oIcon  FILE "..\icons\fivewin.ICO"

DEFINE FONT oFont NAME GetSysFont() SIZE 0 , -14

MENU oMenu POPUP  FONT oFont 2007

     MENUITEM "First"
     MENUITEM "Second"
     MENUITEM "Close this menu"             ACTION oMenu:end()
     MENUITEM "&Exir from prograci"         ACTION oWnd:End()

ENDMENU

ACTIVATE MENU oMenu OF oTray:oWnd AT nRow, nCol

RETURN NIL



#pragma BEGINDUMP

void GetMonitorInfo(){}
void MonitorFromPoint(){}
void MonitorFromWindow(){}
void SetClassLongPtr(){}
void GetClassLongPtr(){}
void SendInput(){}
void PrintWindow(){}
void GetDCBrushColor(){}
void GetMenuInfo(){}
void SetMenuInfo(){}
void GetMenuBarInfo(){}
void GetComboBoxInfo(){}
void GetListBoxInfo(){}
void GetWindowLongPtr(){}

#pragma ENDDUMP
Marco Boschi
info@marcoboschi.it
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TTrayIcon
Posted: Sat Feb 28, 2026 09:45 AM

Dear Marco,

Instead of doing:

ACTIVATE WINDOW oWnd ON INIT oTray := TTrayIcon( oWnd )

Please try this:

ACTIVATE WINDOW oWnd ON INIT ( oWnd:Hide(), oTray := TTrayIcon( oWnd ) )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TTrayIcon
Posted: Sat Feb 28, 2026 06:53 PM

Or

ACTIVATE WINDOW oWnd ON INIT oTray := TTrayIcon( oWnd ) HIDDEN
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: TTrayIcon
Posted: Sat Feb 28, 2026 07:23 PM

Enrico, in TESTTRAY.PRG, is this code correct? Will it work? Why change something that worked perfectly in previous versions?

Enrico, en TESTTRAY.PRG, ¿es correcto este código? ¿Funcionará? ¿Por qué cambiar algo que funcionaba perfectamente en versiones anteriores?

  ACTIVATE WINDOW oWnd ;
     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" ) HIDDEN

Gracias, tks.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: TTrayIcon
Posted: Fri Mar 06, 2026 09:15 AM

Ok Many thanks! This works fine in my pc (windows 10) ACTIVATE WINDOW oWnd ON INIT oTray := TTrayIcon( oWnd ) HIDDEN // Enrico

Bye

Marco Boschi
info@marcoboschi.it

Continue the discussion