TTrayIcon

Post Reply
User avatar
MarcoBoschi
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

TTrayIcon

Post by MarcoBoschi »

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

Code: Select all | Expand

#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
[email protected]
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: TTrayIcon

Post by Antonio Linares »

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
User avatar
Enrico Maria Giordano
Posts: 9054
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: TTrayIcon

Post by Enrico Maria Giordano »

Or

Code: Select all | Expand

ACTIVATE WINDOW oWnd ON INIT oTray := TTrayIcon( oWnd ) HIDDEN
User avatar
karinha
Posts: 8720
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: TTrayIcon

Post by karinha »

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?

Code: Select all | Expand

  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
User avatar
MarcoBoschi
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: TTrayIcon

Post by MarcoBoschi »

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

Bye

Marco Boschi
[email protected]
Post Reply