AutoHotkey Community

It is currently May 27th, 2012, 12:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: September 21st, 2005, 1:15 am 
Offline

Joined: November 28th, 2004, 10:01 am
Posts: 32
Location: USA
Here is a script that illustrates my point.

The last WinActivate is supposed to Activate the other open notepad window.
It doesn't.

-------------------------------

;;test of WinActivate

;;INSTRUCTIONS

;; Open two Notepads
;; (both wintitles = Untitled - Notepad)


;; run this script.

WinActivate, Untitled - Notepad
IfWinActive, Untitled - Notepad
WinGet, notepad1_pid, PID
msgbox notepad1_pid = %notepad1_pid%

WinActivate, Untitled - Notepad,, ahk_pid %notepad1_pid%
IfWinActive, Untitled - Notepad,,ahk_pid %notepad1_pid%
WinGet, notepad2_pid, PID
msgbox notepad2_pid = %notepad2_pid%


;; Please, excuse the lack of indentation.
;; Apparently it is not supported by this web engine.

_________________
||||
------
!!


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 21st, 2005, 9:17 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Anatoly Larkin wrote:
WinActivate, Untitled - Notepad,, ahk_pid %notepad1_pid%
ExcludeTitle doesn't support ahk_pid and similar things. All it does is what the help file says: "Windows whose titles include this value will not be considered." The reason for this is that the added code size doesn't seem justified given how rarely ExcludeTitle is used.

One way to have more control over which window gets activated is with WinActivateBottom.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 21st, 2005, 7:10 pm 
Offline

Joined: November 28th, 2004, 10:01 am
Posts: 32
Location: USA
Some other AHK Window functions seem to support ahk_pid as an argument to ExcludeTitle even though it is not mentioned in the help file.

_________________
||||
------
!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2005, 12:50 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I don't think it's possible because nearly all commands call the same ExcludeTitle code. If you happen to have an example, I'll definitely look into it and get back to you.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 22nd, 2005, 1:14 am 
Offline

Joined: November 28th, 2004, 10:01 am
Posts: 32
Location: USA
Chris wrote:
I don't think it's possible because nearly all commands call the same ExcludeTitle code. If you happen to have an example, I'll definitely look into it and get back to you.


I checked my code and found that I used ahk_pid argument for ExcludeTitle parameter with WinGet.

Based on what you said, however, it seems that my code works correctly not because of what I submit to ExcludeTitle, but just because it works anyway.

Thanks for clarifying.

_________________
||||
------
!!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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