Both methods here no longer work https://autohotkey.com/board/topic/73010-invokeverb/
What is the correct way to pin to taskbar in windows 10
Pin to taskbar in Windows 10
- Micromegas
- Posts: 260
- Joined: 28 Apr 2015, 23:02
- Location: Germany
Re: Pin to taskbar in Windows 10
Are you sure that page talks about pinning to the taskbar? I don't see that mentioned there.
Re: Pin to taskbar in Windows 10
you are correct here is the correct one https://autohotkey.com/board/topic/9389 ... utohotkey/Micromegas wrote:Are you sure that page talks about pinning to the taskbar? I don't see that mentioned there.
also i think its not possible in windows 10
Re: Pin to taskbar in Windows 10
This link suggests a method that may have worked on Windows 10, but that apparently no longer works.
Where is the list of pinned start menu and taskbar items stored in Windows 7 - Super User
https://superuser.com/questions/171096/ ... -windows-7
I have a slightly hacky workaround that uses Acc to pin WordPad to the taskbar, that works in Windows 7, it right-clicks the taskbar button and chooses 'Pin this program to taskbar' if available. So it's possible that that might work in Windows 10. It may be that the script needs to be modified slightly if the system language isn't English.
Some related code:
Move mouse to taskbar to use AeroPeek - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27147
Explorer window interaction (folder windows/Desktop, file/folder enumeration/selection/navigation/creation) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=35041
Where is the list of pinned start menu and taskbar items stored in Windows 7 - Super User
https://superuser.com/questions/171096/ ... -windows-7
I have a slightly hacky workaround that uses Acc to pin WordPad to the taskbar, that works in Windows 7, it right-clicks the taskbar button and chooses 'Pin this program to taskbar' if available. So it's possible that that might work in Windows 10. It may be that the script needs to be modified slightly if the system language isn't English.
Code: Select all
;[Acc functions]
;Acc library (MSAA) and AccViewer download links - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
q:: ;explorer - pin WordPad to the taskbar (tested on Windows 7)
DetectHiddenWindows, Off
Run, wordpad.exe,,, vPID
WinWaitActive, % "ahk_pid " vPID
WinGet, vWinList, List, % "ahk_pid " vPID
oArray := {}
Loop, % vWinList
{
hWnd := vWinList%A_Index%
WinGetTitle, vWinTitle, % "ahk_id " hWnd
if !(vWinTitle = "")
oArray["z" vWinTitle] := ""
}
ControlGet, hWnd, Hwnd,, MSTaskListWClass1, ahk_class Shell_TrayWnd
oAcc := Acc_Get("Object", "4", 0, "ahk_id " hWnd)
Loop, % oAcc.accChildCount
{
vName := ""
try vName := oAcc.accName(A_Index)
if oArray.HasKey("z" vName)
{
oRect := Acc_Location(oAcc, A_Index)
CoordMode, Mouse, Screen
Click, % Format("R, {:i}, {:i}", oRect.x + oRect.w/2, oRect.y + oRect.h/2)
;ToolTip, % Format("R, {:i}, {:i}", oRect.x + oRect.w/2, oRect.y + oRect.h/2)
WinWaitActive, Jump List ahk_class DV2ControlHost
ControlGet, hWnd, Hwnd,, SysListView321, Jump List ahk_class DV2ControlHost
oAcc2 := Acc_Get("Object", "4", 0, "ahk_id " hWnd)
Loop, % oAcc2.accChildCount
{
vName := ""
try vName .= oAcc2.accName(A_Index)
;ToolTip, % A_Index " " vName
;Sleep, 1000
if (vName = "Pin this program to taskbar")
{
oAcc2.accDoDefaultAction(A_Index)
break
}
}
if (vName = "Pin this program to taskbar")
break
}
}
oAcc := oRect := oArray := ""
return
Move mouse to taskbar to use AeroPeek - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27147
Explorer window interaction (folder windows/Desktop, file/folder enumeration/selection/navigation/creation) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=35041
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Pin to taskbar in Windows 10
does not work on windows 10, I even updated this to match how it reads on windows 10 (vName = "Pin to taskbar") (I have acc etc)jeeswg wrote:This link suggests a method that may have worked on Windows 10, but that apparently no longer works.
Where is the list of pinned start menu and taskbar items stored in Windows 7 - Super User
https://superuser.com/questions/171096/ ... -windows-7
I have a slightly hacky workaround that uses Acc to pin WordPad to the taskbar, that works in Windows 7, it right-clicks the taskbar button and chooses 'Pin this program to taskbar' if available. So it's possible that that might work in Windows 10. It may be that the script needs to be modified slightly if the system language isn't English.
Some related code:Code: Select all
;[Acc functions] ;Acc library (MSAA) and AccViewer download links - AutoHotkey Community ;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201 q:: ;explorer - pin WordPad to the taskbar (tested on Windows 7) DetectHiddenWindows, Off Run, wordpad.exe,,, vPID WinWaitActive, % "ahk_pid " vPID WinGet, vWinList, List, % "ahk_pid " vPID oArray := {} Loop, % vWinList { hWnd := vWinList%A_Index% WinGetTitle, vWinTitle, % "ahk_id " hWnd if !(vWinTitle = "") oArray["z" vWinTitle] := "" } ControlGet, hWnd, Hwnd,, MSTaskListWClass1, ahk_class Shell_TrayWnd oAcc := Acc_Get("Object", "4", 0, "ahk_id " hWnd) Loop, % oAcc.accChildCount { vName := "" try vName := oAcc.accName(A_Index) if oArray.HasKey("z" vName) { oRect := Acc_Location(oAcc, A_Index) CoordMode, Mouse, Screen Click, % Format("R, {:i}, {:i}", oRect.x + oRect.w/2, oRect.y + oRect.h/2) ;ToolTip, % Format("R, {:i}, {:i}", oRect.x + oRect.w/2, oRect.y + oRect.h/2) WinWaitActive, Jump List ahk_class DV2ControlHost ControlGet, hWnd, Hwnd,, SysListView321, Jump List ahk_class DV2ControlHost oAcc2 := Acc_Get("Object", "4", 0, "ahk_id " hWnd) Loop, % oAcc2.accChildCount { vName := "" try vName .= oAcc2.accName(A_Index) ;ToolTip, % A_Index " " vName ;Sleep, 1000 if (vName = "Pin this program to taskbar") { oAcc2.accDoDefaultAction(A_Index) break } } if (vName = "Pin this program to taskbar") break } } oAcc := oRect := oArray := "" return
Move mouse to taskbar to use AeroPeek - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27147
Explorer window interaction (folder windows/Desktop, file/folder enumeration/selection/navigation/creation) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=35041
Re: Pin to taskbar in Windows 10
- Plus, it's always worth running a script as admin just in case.
- I rarely if ever say, is this really worth automating, and indeed I thought it was sufficiently worthwhile that I made an attempt. However, typically, you only need to pin more than one item to the taskbar when you first get a PC, unless you're installing lots of PCs. So I'm curious if this is very important to you. So I'm asking out of interest, in case this is a major problem for you, but it doesn't have to be. I like to try and fix certain things just for the sake of it, even for tiny convenience gains, to understand things, or for the challenge, i.e. every little Explorer thing should ideally be automatable.
- In the worst case scenario, you could have a script that opens each window, you manually pin it and close it, it detects that the window has closed, and opens up the next window. E.g. use RunWait, or Run and WinWaitClose.
- I rarely if ever say, is this really worth automating, and indeed I thought it was sufficiently worthwhile that I made an attempt. However, typically, you only need to pin more than one item to the taskbar when you first get a PC, unless you're installing lots of PCs. So I'm curious if this is very important to you. So I'm asking out of interest, in case this is a major problem for you, but it doesn't have to be. I like to try and fix certain things just for the sake of it, even for tiny convenience gains, to understand things, or for the challenge, i.e. every little Explorer thing should ideally be automatable.
- In the worst case scenario, you could have a script that opens each window, you manually pin it and close it, it detects that the window has closed, and opens up the next window. E.g. use RunWait, or Run and WinWaitClose.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Pin to taskbar in Windows 10
it started off as a cool idea that after someone in my company installs the small program im making it auto pins it. It is not as important as the other parts of the program I am still working onjeeswg wrote:- Plus, it's always worth running a script as admin just in case.
- I rarely if ever say, is this really worth automating, and indeed I thought it was sufficiently worthwhile that I made an attempt. However, typically, you only need to pin more than item to the taskbar when you first get a PC, unless you're installing lots of PCs. So I'm curious if this is very important to you.
- In the worst case scenario, you could have a script that opens each window, you manually pin it and close it, it detects that the window has closed, and opens up the next window.
thank you for your code, the acc part is very new to me
Re: Pin to taskbar in Windows 10
The Solution I used was to make a copy of AutoHotkey.exe in the installed dir and rename it to something that Windows 10 allows to be pinned. I used AHKscripts.exe if you want to run the AutoHotkey.ahk script automatically when the taskbar pin is clicked, make a copy of AutoHotkey.ahk and rename it to the same filename as the AutoHotkey.exe copy (i.e. AHKscripts.ahk) you can also pin ahk scripts to this taskbar icon and right click to select.
Who is online
Users browsing this forum: No registered users and 342 guests