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 

Quickly hide trayicons, taskbar and quicklaunch
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Lexikos



Joined: 17 Oct 2006
Posts: 2737
Location: Australia, Qld

PostPosted: Fri Mar 21, 2008 10:43 pm    Post subject: Reply with quote

You want the hWnd, which indicates which window belongs to the button. The buttons are listed in the same order they appear on the task bar. Here's a demonstration using grep:
Code:
; Get all taskbar button info.
icons := TaskButtons()
; Grab a list of hwnds.
grep(icons, "(?<=\| hWnd: )(?:0x[0-9a-f]+|\d+)(?= \|)", hwnds)
; Split it into a quasi-array.
StringSplit, hwnd, hwnds, 

; Activate the third button:
WinActivate, ahk_id %hwnd3%
I account for hexadecimal format in the regular expression, though TaskButtons() doesn't work with it as is. The first line of TaskButtons() would need to be replaced with something like:
Code:
    fi := A_FormatInteger
    SetFormat, Integer, D
    idxTB := GetTaskSwBar()
    SetFormat, Integer, %fi%
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
Goto page Previous  1, 2
Page 2 of 2

 
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