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 

RefreshTray()

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
HotKeyIt



Joined: 18 Jun 2008
Posts: 2197
Location: GERMANY

PostPosted: Tue Oct 21, 2008 11:02 pm    Post subject: RefreshTray() Reply with quote

Remove icons from Tray menu for crashed or terminated scripts\apps.

There was a script that refreshed the tray by moving the mouse over the tray but I cannot find it anymore.
Anyway I have found a solution on web in c++ and did the same in ahk. Sorry if this has been already posted.

So when your script crashes and you call this function try icon will be removed.
It sends mouse movement over the icons trough PostMessage.

Code:
RefreshTray(){
   ControlGetPos,,,w,h,ToolbarWindow321, AHK_class Shell_TrayWnd
   width:=w, hight:=h
   While % ((h:=h-5)>0 and w:=width){
      While % ((w:=w-5)>0){
         PostMessage, 0x200,0,% ((hight-h) >> 16)+width-w,ToolbarWindow321, AHK_class Shell_TrayWnd
      }
   }
}


Last edited by HotKeyIt on Mon Jul 06, 2009 7:38 pm; edited 2 times in total
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5042
Location: /b/

PostPosted: Fri Oct 24, 2008 5:58 pm    Post subject: Reply with quote

I never thought this was possible but it actually works! Thanks.
_________________
Chat (IRC)PlusNetScriptsIronAHK Contact by email not private message.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
HotKeyIt



Joined: 18 Jun 2008
Posts: 2197
Location: GERMANY

PostPosted: Mon Jul 06, 2009 7:27 pm    Post subject: Reply with quote

I've cut down and improved the code Wink
_________________
AutoHotFile - ToolTip(n,text,title,options) Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions 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