| View previous topic :: View next topic |
| Author |
Message |
kidmar
Joined: 04 Oct 2007 Posts: 30
|
Posted: Tue Sep 30, 2008 9:59 am Post subject: [SOLVED] Hide Tray Icon |
|
|
Hi.
I've read a lot about this topic and i'm sorry to open a new one, but I can't undrstand anything written on these topics
There is too much code and I can't find the little part that I need.
http://www.autohotkey.com/forum/topic17314-30.html
http://www.autohotkey.com/forum/viewtopic.php?t=18652
http://www.autohotkey.com/forum/topic11435.html
I need to hide the tray icon of one active process.
I can run that program from an ahk script.
I understood there is something to do with TB_DELETEBUTTON or TB_HIDEBUTTON.
I think I should do 2 things:
1) Find the ID of the try icon of my process
2) Send a message (maybe TB_HIDEBUTTON) to the trybar telling to hide that icon.
Can someone help me with an easy and (I hope so) short way to do that?
Thank you and sorry if my question was already answered.
Last edited by kidmar on Thu Oct 02, 2008 10:28 am; edited 1 time in total |
|
| Back to top |
|
 |
jamie.ds
Joined: 23 Jul 2008 Posts: 39
|
Posted: Tue Sep 30, 2008 11:44 am Post subject: |
|
|
heIt's not really a hard code. Just place
At the top of the script.
For example;
| Code: |
#NoTrayIcon
Some sort of code goes here.
|
Done hope that helped. |
|
| Back to top |
|
 |
kidmar
Joined: 04 Oct 2007 Posts: 30
|
Posted: Tue Sep 30, 2008 11:53 am Post subject: |
|
|
| Quote: |
heIt's not really a hard code. Just place
|
Well this hides Autohokey's Tray Icon, not the icon of another process.
I need to run an exe and hide the tray icon that exe creates. |
|
| Back to top |
|
 |
Chavez
Joined: 20 Aug 2008 Posts: 153
|
Posted: Tue Sep 30, 2008 1:38 pm Post subject: |
|
|
| jamie.ds wrote: | heIt's not really a hard code. Just place
At the top of the script.
For example;
| Code: |
#NoTrayIcon
Some sort of code goes here.
|
Done hope that helped. |
I think he wants his .exe to hide another .exe's tray icon.
Am i right, kidmar? _________________ -Chavez. |
|
| Back to top |
|
 |
kidmar
Joined: 04 Oct 2007 Posts: 30
|
Posted: Tue Sep 30, 2008 2:00 pm Post subject: |
|
|
Yes Chavez you're right!
But didn't I write it before?  |
|
| Back to top |
|
 |
Chavez
Joined: 20 Aug 2008 Posts: 153
|
Posted: Tue Sep 30, 2008 4:28 pm Post subject: |
|
|
| kidmar wrote: | Yes Chavez you're right!
But didn't I write it before?  |
I simplified it a little, it'll bring in more help, mark my words. _________________ -Chavez. |
|
| Back to top |
|
 |
alexwalter88
Joined: 30 Sep 2008 Posts: 2 Location: Canada
|
Posted: Tue Sep 30, 2008 7:28 pm Post subject: |
|
|
Ya I am also looking at hiding an annoying and pointless system tray icon. I'm new here and I only have a little programming experience.
Anyway, I looked at the "Extract Informations about TrayIcons" thread but didn't understand it fully or get it to work. |
|
| Back to top |
|
 |
alexwalter88
Joined: 30 Sep 2008 Posts: 2 Location: Canada
|
Posted: Wed Oct 01, 2008 11:07 pm Post subject: |
|
|
bump
I know it looks like this problem has been answered before but I just don't understand or get it to work. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1397
|
Posted: Thu Oct 02, 2008 9:46 am Post subject: |
|
|
The key is how you're gonna identify the target application. After that it's straightforward. You can use application name or PID for that. For example, suppose the name of the target application is app.exe, then it becomes
| Code: | | RegExMatch(TrayIcons("app.exe"), "(?<=idn: )\d+", idn), HideTrayIcon(idn) |
|
|
| Back to top |
|
 |
kidmar
Joined: 04 Oct 2007 Posts: 30
|
Posted: Thu Oct 02, 2008 10:27 am Post subject: |
|
|
Ok here is the solution:
Download the AHK script TrayIcon.ahk.
You can find it here:
http://www.autohotkey.com/forum/topic17314.html
It has many functions to work with TrayIcons.
If you want to hide "yourapp.exe" edit that script.
Cut off this:
| Code: | | MsgBox % TrayIcons() |
And place this instead of it:
| Code: | RegExMatch(TrayIcons("yourapp.exe"), "(?<=idn: )\d+", idn) ; This finds out the ID of the Tray Icon of "yourapp.exe"
HideTrayIcon(idn) ; This hides that icon :D |
This works to me. |
|
| Back to top |
|
 |
|