Page 1 of 1

How to Select Only Taskbar icons/tabs?

Posted: 09 Feb 2014, 03:22
by PotentialUser
Does anyone know how to identify/select only icons on the Win7 taskbar?

Re: How to Select Only Taskbar icons/tabs?

Posted: 09 Feb 2014, 16:46
by Zelio
I don't know and too vague... but do you mean a simple "alt + tab" ? Or how retrieve the icon with a code like SendMessage, WM_GETICON, ICON_BIG , 0,, ahk_id %Handle%
SendMessage, WM_GETICON, ICON_SMALL, 0,, ahk_id %Handle%

Re: How to Select Only Taskbar icons/tabs?

Posted: 10 Feb 2014, 03:53
by PotentialUser
I want to make a keystroke combination that only works on the taskbar icons and no where else. I don't like the idea of using the mouse position but I think that could work.

Re: How to Select Only Taskbar icons/tabs?

Posted: 10 Feb 2014, 11:29
by Zelio
Maybe barriere language (sry I'm french), I am not sure to understand, however if your "on" means "when mouse over" I guess you have to use mouse position but without to use coordinate (that is a big nuance).

Try this example from manual, a tooltip to understand and I added a hotkey for your case with win 7

Code: Select all

; This example allows you to move the mouse around to see
; the title of the window currently under the cursor:
#Persistent
SetTimer, WatchCursor, 100
return

WatchCursor:
MouseGetPos, , , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
ToolTip, ahk_id %id%`nahk_class %class%`n%title%`nControl: %control%
return

~a::
MouseGetPos, , , id, control
WinGetClass, class, ahk_id %id%
if (class="Shell_TrayWnd" and control="MSTaskListWClass1")
	msgbox mouse overed tasklist bar and you pressed "a" key
return

esc::
exitapp
Maybe register you on this forum and show your current basic code.

Re: How to Select Only Taskbar icons/tabs?

Posted: 11 Feb 2014, 03:22
by PotentialUser
Thanks Zelio!

This looks like what I want:

MouseGetPos, , , id, control
WinGetClass, class, ahk_id %id%
if (class="Shell_TrayWnd" and control="MSTaskListWClass1")
msgbox mouse overed tasklist bar and you pressed "a" key


I got a bigger problem now that I have to resolve from running another script:
--------------------------------------
I messed up my left touchpad and mouse, button now. I removed the ^/control and used just ~Lbutton::

I tried it out and was doing control left touchpad as well to try and bring other windows forward to see if the window was really on top or not.

Now my left touchpad button sticks on sometimes. The same exact behavior occurs if I use a USB mouse. A restore to the last time I did a windows defender update keeps failing. It's probably something in the registry but I'm very leary of messing with that.

Has anybody else figured out how to fix problems like this??

Thanks in advance!

Re: How to Select Only Taskbar icons/tabs?

Posted: 11 Feb 2014, 05:19
by PotentialUser
Well it's was just a sticky touchpad key :| What threw me is the USB mouse that I grabbed also had a bad left mouse button; what was the odds of that?