AutoHotkey Community

It is currently May 24th, 2012, 6:58 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Thunderbird Mailclient
PostPosted: January 11th, 2005, 7:48 pm 
Offline

Joined: January 11th, 2005, 7:27 pm
Posts: 13
Hello,

I'm using Thunderbird as mailclient with the tool Thunderbird-Tray. This puts Thunderbird in the systray.

With an application (like Firefox) I start it with this script:

Code:
;WIN-1
#1::
SetTitleMatchMode, 2
IfWinExist, Firefox
{
   WinActivate
   WinMove, 0, 0 
}
else
{
   Run, "C:\Programme\Mozilla Firefox\firefox.exe"
   WinWait, Firefox
   WinActivate
   WinMove, 0, 0 
}
return


But this doesn't work if the application is in the systray. Is there a way to solve this for Thunderbird, which is in the systray and not in the taskbar.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2005, 10:04 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
The systray is one of Microsoft's innumerable blunders... it's mysterious and hard to access as a programmer (like Chris). We could really use a lot more options that have to do with the systray, and I'm sure Chris would deliver, were there an easy way to do it. The closest we've been able to come in most cases is PixelSearch, or the improvised "ImageSearch" that works better in some cases.

In this case, I would suggest trying this line of code (at the top of the script.)

Code:
DetectHiddenWindows, On


This allows AHK to detect hidden windows for commands like IfWinExist. Almost every application that's "minimized to the tray" is really just hidden, in my experience.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2005, 8:30 pm 
Offline

Joined: January 11th, 2005, 7:27 pm
Posts: 13
Yes, it works. Here is the complete script.

Code:
#3::
DetectHiddenWindows, On
app = Thunderbird
prg = "C:\Programme\Mozilla Thunderbird\thunderbird.exe"
SetTitleMatchMode, 2
IfWinActive, %app%
{
   WinActivate, ahk_class Shell_TrayWnd
   WinClose, %app%
   return
}
IfWinExist, %app%
{
   WinActivate
   WinMove, 0, 0 
}
else
{
   Run, %prg%
   WinWait, %app%
   WinActivate
   WinMove, 0, 0 
}
return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Bing [Bot], ELengefeld, Google [Bot], Google Feedfetcher, janopn, Kirtman, Pulover, quintijn, Yahoo [Bot] and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group