Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Is there a way to pin program to taskbar using Autohotkey



  • Please log in to reply
5 replies to this topic
Cattleya
  • Members
  • 90 posts
  • Last active: Sep 13 2013 05:11 AM
  • Joined: 28 Sep 2011

Hi all Autohotkey Forum member.

I've searched AHK forum many time but only a few result about this topic but no answer at all, so I create this thread, I hope someone help me solve this problem

I'm making a installer using Autohotkey, I add create shortcut to desktop, quick launch feature to my installer and work, but when I try to add pin my app to taskbar feature, I can't find a way to do that. I tried to create my shortcut inside

C:\Users\<MyUsername>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

 

And restart my explorer.exe but nothing happen, seem only place my shortcut inside this folder cannot create pin item on taskbar.

I also found this post, but it was wrote in AutoIt, I cannot convert it to Autohotkey because it is out of my knowledge. Hope someone will help me.

http://www.autoitscr...kbar/?p=1050255

 

For Autohotkey I found InvokeVerb, but I don't know how to use.

 

Searched thread:

https://www.google.c...oq=&gs_l=&pbx=1



nothing
  • Members
  • 129 posts
  • Last active: Oct 03 2014 04:51 AM
  • Joined: 09 Jan 2010
✓  Best Answer

Hi there,
Nice to see you here.
Here's the solution:

Spoiler

nothing is impossible with ahk (_L).
Excuse my bad English.
Busy

Cattleya
  • Members
  • 90 posts
  • Last active: Sep 13 2013 05:11 AM
  • Joined: 28 Sep 2011

Thank you, nothing.

Your solution work perfectly :)

 

I also figure how to use  InvokeVerb, here is my example:

#Persistent

InvokeVerb("C:\Windows\System32\calc.exe", "Pin to Taskbar") ; or replace Pin to Taskbar with Pin to Start Menu to create pinned item on Start Menu

InvokeVerb(path, menu, validate=True) {
	;by A_Samurai
	;v 1.0.1 http://sites.google.com/site/ahkref/custom-functions/invokeverb
    objShell := ComObjCreate("Shell.Application")
    if InStr(FileExist(path), "D") || InStr(path, "::{") {
        objFolder := objShell.NameSpace(path)   
        objFolderItem := objFolder.Self
    } else {
        SplitPath, path, name, dir
        objFolder := objShell.NameSpace(dir)
        objFolderItem := objFolder.ParseName(name)
    }
    if validate {
        colVerbs := objFolderItem.Verbs   
        loop % colVerbs.Count {
            verb := colVerbs.Item(A_Index - 1)
            retMenu := verb.name
            StringReplace, retMenu, retMenu, &       
            if (retMenu = menu) {
                verb.DoIt
                Return True
            }
        }
        Return False
    } else
        objFolderItem.InvokeVerbEx(Menu)
}



jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
I dont like the pin-function in win7
Is there a way to add a toolbar to the taskbar?
A specific folder like "D:\toolbar\"

http://www.tomstrick...r-in-windows-7/

Screenshot
Screenshot2
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

nothing
  • Members
  • 129 posts
  • Last active: Oct 03 2014 04:51 AM
  • Joined: 09 Jan 2010

@Cattleya: you're welcome.

@jNizM: is this? --> http://www.autohotke...-taskbar/page-2


nothing is impossible with ahk (_L).
Excuse my bad English.
Busy

Cattleya
  • Members
  • 90 posts
  • Last active: Sep 13 2013 05:11 AM
  • Joined: 28 Sep 2011

@Cattleya: you're welcome.

@jNizM: is this? --> http://www.autohotke...-taskbar/page-2

Sorry for bumping my topic, But can I ask you a question about "Pin to Tas&kbar", is this menu work on Windows XP or only Windows 7 ?