AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] Hide Tray Icon

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
kidmar



Joined: 04 Oct 2007
Posts: 30

PostPosted: Tue Sep 30, 2008 9:59 am    Post subject: [SOLVED] Hide Tray Icon Reply with quote

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 Sad
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
View user's profile Send private message
jamie.ds



Joined: 23 Jul 2008
Posts: 39

PostPosted: Tue Sep 30, 2008 11:44 am    Post subject: Reply with quote

heIt's not really a hard code. Just place
Code:

#NoTrayIcon


At the top of the script.

For example;

Code:

#NoTrayIcon

Some sort of code goes here.



Done hope that helped.
Back to top
View user's profile Send private message
kidmar



Joined: 04 Oct 2007
Posts: 30

PostPosted: Tue Sep 30, 2008 11:53 am    Post subject: Reply with quote

Quote:

heIt's not really a hard code. Just place
Code:

#NoTrayIcon



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
View user's profile Send private message
Chavez



Joined: 20 Aug 2008
Posts: 153

PostPosted: Tue Sep 30, 2008 1:38 pm    Post subject: Reply with quote

jamie.ds wrote:
heIt's not really a hard code. Just place
Code:

#NoTrayIcon


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
View user's profile Send private message MSN Messenger
kidmar



Joined: 04 Oct 2007
Posts: 30

PostPosted: Tue Sep 30, 2008 2:00 pm    Post subject: Reply with quote

Yes Chavez you're right!
But didn't I write it before? Razz
Back to top
View user's profile Send private message
Chavez



Joined: 20 Aug 2008
Posts: 153

PostPosted: Tue Sep 30, 2008 4:28 pm    Post subject: Reply with quote

kidmar wrote:
Yes Chavez you're right!
But didn't I write it before? Razz


I simplified it a little, it'll bring in more help, mark my words.
_________________
-Chavez.
Back to top
View user's profile Send private message MSN Messenger
alexwalter88



Joined: 30 Sep 2008
Posts: 2
Location: Canada

PostPosted: Tue Sep 30, 2008 7:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
alexwalter88



Joined: 30 Sep 2008
Posts: 2
Location: Canada

PostPosted: Wed Oct 01, 2008 11:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1397

PostPosted: Thu Oct 02, 2008 9:46 am    Post subject: Reply with quote

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
View user's profile Send private message
kidmar



Joined: 04 Oct 2007
Posts: 30

PostPosted: Thu Oct 02, 2008 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group