AutoHotkey Community

It is currently May 26th, 2012, 11:52 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: November 12th, 2009, 1:50 pm 
say I have two windows with the same title - how can I make controlsend etc differentiate between the two?
Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2009, 2:48 pm 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
Find the Unique id (PID) of each window.

WinGet

Then use the PID in your controlsend command.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2009, 3:06 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
@doyle, you surely mean hWnd (window handle), not PID (process identifier).
Code:
WinGet,List,List,Title of Your Window
Loop % list
 MsgBox % list%A_Index%

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 30th, 2010, 8:14 pm 
Offline

Joined: January 29th, 2010, 6:05 pm
Posts: 41
Location: Decatur, AL
Im having trouble with this... I have two windows with the same name but would like to have different macros run from one hotkey depending on which window it is.

I tried the above code, but can not seem to get a msgbox. Sorry for this noob question, but what am I doing wrong?

Code:
p::
WinGet,List,List,S2K Enterprise - NAFECO
Loop % list
 MsgBox % list%A_Index%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 30th, 2010, 8:17 pm 
Offline

Joined: January 29th, 2010, 6:05 pm
Posts: 41
Location: Decatur, AL
doh... i forgot the { }. got the msg box to work now.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 30th, 2010, 9:50 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
You should use #IfWinActive therefore.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: hyper_, Leef_me, patgenn123, Pulover, rbrtryn, tidbit, XstatyK and 19 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