[LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

Post your working scripts, libraries and tools
User avatar
cyruz
Posts: 243
Joined: 30 Sep 2013, 13:31

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

26 Oct 2014, 06:24

Yeah I confirm that Remove is more reliable. A lot of times i ended up deleting the wrong icon with Delete, because the number of icons changed...
ABCza on the old forum.
My GitHub.
kidbit
Posts: 168
Joined: 02 Oct 2013, 16:05

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

27 Oct 2014, 12:10

Can I restore the icons after I deleted/removed them?

Hiding an icon works this way: the icon disappears, yet the space it occupied in tray remains still reserved for that icon, so it may look like this:
Image

Also, there seems to be a small issue with hiding/restoring: if you hide all icons and then try to restore them - only a portion of them (3 for me) will get restored, but if you try to restore them once again - the rest will get restored.
It also restores some system icons that got hidden by some checkboxes somewhere.
question := (2b) || !(2b) © Shakespeare.
FanaticGuru
Posts: 801
Joined: 30 Sep 2013, 22:25

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

27 Oct 2014, 15:01

kidbit wrote:Can I restore the icons after I deleted/removed them?

Also, there seems to be a small issue with hiding/restoring: if you hide all icons and then try to restore them - only a portion of them (3 for me) will get restored, but if you try to restore them once again - the rest will get restored.
It also restores some system icons that got hidden by some checkboxes somewhere.


A lot of these functions are just sending Windows a message to execute built-in stuff. Here is the Microsoft help on the messages sent:
http://msdn.microsoft.com/en-us/library/windows/desktop/ff486063(v=vs.85).aspx

Delete and Remove both cause Windows to execute a command that I believe really deletes the tray icons with no means to restore them.

Hide again is just sending Windows a message and Windows is doing all the heavy lifting. Leaving the blank space for a hidden icon is just a feature of Windows.

As for the having to do it two times, I imagine this could have something to do with the two tray areas of the Tray window and the Overflow window. Sometimes Windows thinks a tray icon is in one area but it is really in the other. That is just a theory that could be totally wrong.

I have had problems before trying to Remove a tray icon and Windows being unable to do so because a tray icon is not where expected until Windows does an update of the tray icon areas and gets the tray icon in the area expected.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
hotkeyguy
Posts: 115
Joined: 11 Oct 2014, 12:22

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

21 Jan 2015, 13:35

Hello,

and first of all many thanks for that library.

Is it technically possible to trigger an menu item of an tray icon without showing the menu of the tray icon itself?
Any hints?


Many thanks and greetings
hotkeyguy
User avatar
cyruz
Posts: 243
Joined: 30 Sep 2013, 13:31

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

24 Jan 2015, 16:11

Yes, with Window Detective you can try to catch the message that is sent when you click on the menu item and use it with the Post/SendMessage AutoHotkey command. If you need help, open a dedicated thread in the Help section :)
ABCza on the old forum.
My GitHub.
Geob

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

17 Mar 2015, 06:14

Hi,

thank you for this library!

About the TrayIcon_Button function above, does it work for someone?
Geob

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

17 Mar 2015, 09:26

Strange, had to double click to make it works, maybe a bug? The application is Telegram Desktop, it's written in Qt, maybe the bug is in how the click event is managed by Qt?
-_+
Posts: 70
Joined: 06 Dec 2014, 12:43

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

10 Oct 2015, 21:02

There's something wrong with the TrayIcon_Hide() function:
1. It accepts idx (not idcmd) as 1st param.
2. seems like it has it's own list of icons' indexes, because they don't match the indexes returned by TrayIcon_GetInfo(). Some indexes hide a few icons at once: turns out it depends on the taskbar's position and size.
For example:
Vertical taskbar: 2, 3, 4, 5 and 6 columns + TrayIcon_Hide() result into 2, 3, 4, 1 and 6 icons (respectively) getting hidden.
Horizontal taskbar: 1, 2, 3, 4, and 5 rows + TrayIcon_Hide() result into 1, 1, 1, 1, and 6 icons (respectively) getting hidden.

A series of tests showed that this function always hides either 0 icons, 1 icon or 1 row of icons (irregardless of number of icons in the row).

Could anyone, please, confirm and/or fix this issue?
User avatar
SL5
Posts: 79
Joined: 12 May 2015, 02:10
GitHub: sl5net
Contact:

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

19 Jan 2016, 04:01

hi i want set no no TrayIcon for all running scripts (noTrayIcon4AllRunningScripts.ahk)

is there a way to to this with trayicon.ahk ? TrayIcon_Hide(idn) ?

thanks
SL5_AHK_Refactor_engine: viewtopic.php?f=22&t=8678 , online AHK prettyfy viewtopic.php?f=22&t=8678 , https://www.mikogo.com
jmeneses
Posts: 402
Joined: 28 Oct 2014, 11:09

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

19 Jan 2016, 04:29

Hi SL5
I have a similar script to hide/unhide my AHK scripts compiled using TrayIcon
This

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by jmeneses on 19 Jan 2016, 05:35, edited 1 time in total.
User avatar
SL5
Posts: 79
Joined: 12 May 2015, 02:10
GitHub: sl5net
Contact:

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

19 Jan 2016, 05:15

jmeneses wrote:Hi SL5
I have a similar script to hide/unhide my AHK scripts compiled using TrayIcon
mine seems not completly working.


no success with mine or/and your script. may my exampleHideAllAutohotkey() is wrong written?

This (updated 16-01-19_11-21):

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

SL5_AHK_Refactor_engine: viewtopic.php?f=22&t=8678 , online AHK prettyfy viewtopic.php?f=22&t=8678 , https://www.mikogo.com
jmeneses
Posts: 402
Joined: 28 Oct 2014, 11:09

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

19 Jan 2016, 05:37

My example uses a copy of this post
User avatar
SL5
Posts: 79
Joined: 12 May 2015, 02:10
GitHub: sl5net
Contact:

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

19 Jan 2016, 05:41

jmeneses wrote:My example uses a copy of this post

was i tring to do with exampleHideAllAutohotkey() is to hide all tray icons if i working with laptop.
in other situations i will unHide trayIcons again. is that possivle with this functtons?

my problem is that my Tray is to full. so i searching solutions for it. see how full:

2016-01-19 11_40_30-.png
SL5_AHK_Refactor_engine: viewtopic.php?f=22&t=8678 , online AHK prettyfy viewtopic.php?f=22&t=8678 , https://www.mikogo.com
highend
Posts: 43
Joined: 24 Nov 2014, 16:57

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

22 Jul 2016, 16:34

Is there any way to get the info about a tray icon if it is currently hidden / visible?
Leito

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

20 Oct 2017, 04:39

The library with the TrayIcon_Button function doesn't work on Windows 10 1709. Any idea how to fix this?

For reference, this is the code I use (I hope I have the latest):

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
SL5
Posts: 79
Joined: 12 May 2015, 02:10
GitHub: sl5net
Contact:

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

21 Oct 2017, 09:28

thanks works for me (Win7 64bit):

test := TrayIcon_GetInfo() Loop, % test.MaxIndex() ... TrayIcon_Delete(test[A_Index].idx)

frees may tray comletly :) great :) :bravo:
SL5_AHK_Refactor_engine: viewtopic.php?f=22&t=8678 , online AHK prettyfy viewtopic.php?f=22&t=8678 , https://www.mikogo.com
Vince42
Posts: 6
Joined: 05 Feb 2016, 14:41

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

18 Nov 2017, 19:32

Hi,

Leito wrote:The library with the TrayIcon_Button function doesn't work on Windows 10 1709. Any idea how to fix this?
For reference, this is the code I use (I hope I have the latest):


Same problem here. I also tried IRC and read some posts about problems on StackOverflow, but did not succeed in getting it running.
Any ideas? Any news on this?

Cheers
Vince
RiseUp
Posts: 25
Joined: 01 Oct 2013, 21:27

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

19 Nov 2017, 23:31

Vince42 wrote:Same problem here. I also tried IRC and read some posts about problems on StackOverflow, but did not succeed in getting it running.
Any ideas? Any news on this?

Cheers
Vince

Can you share the code you have that isn't working?
Vince42
Posts: 6
Joined: 05 Feb 2016, 14:41

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

20 Nov 2017, 05:27

Hi,

RiseUp wrote:
Vince42 wrote:Same problem here. I also tried IRC and read some posts about problems on StackOverflow, but did not succeed in getting it running.
Any ideas? Any news on this?

Cheers
Vince

Can you share the code you have that isn't working?


Sure, no problem. I am using the current official version of SysTray.ahk and the code snippet that is not working currently reads like this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



One thing came to my mind: The executable is called "tvbrowser.exe" but as this is a Java executable it is - according to the task manager - invoking "java.exe". I already unsuccessfully tried the function call with "java.exe". Maybe I should first try to read all tray icon information with TrayIcon_GetInfo()?

Cheers
Vince
RiseUp
Posts: 25
Joined: 01 Oct 2013, 21:27

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

20 Nov 2017, 20:17

Vince42 wrote:I am using the current official version of SysTray.ahk and the code snippet that is not working currently reads like this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



One thing came to my mind: The executable is called "tvbrowser.exe" but as this is a Java executable it is - according to the task manager - invoking "java.exe". I already unsuccessfully tried the function call with "java.exe". Maybe I should first try to read all tray icon information with TrayIcon_GetInfo()?

Cheers
Vince

If it appears in Task Manager as java.exe, then surely that could be the issue. Also, the uncommented call to the library function in your code simulates a single-click with the left mouse button. Is that what you're trying for?

Using TrayIcon_GetInfo() would definitely help to debug your issue, but it isn't necessary to get it working once you have the right parameter(s) figured out for TrayIcon_Button().

Return to “Scripts and Functions”

Who is online

Users browsing this forum: cocobanana, Delta Pythagorean and 17 guests