Hello & Thanks ;
Is it possible to pin an app to taskbar programmatically ?
Are there any examples ?
I am writing a tiny program that does one thing ,
it opens the Folder c:\myLauncher .
My simple plan is to fill c:\myLauncher with all the shortcuts that I use the most , sorted alphabetically .
And I want to pin the app to taskbar programmatically .
Hmm.. Curious-er and Curious-er :
Then of course I would need to be able to check if the program is pinned to taskbar .
Tiny program is not looking so tiny or simple anymore .
A batch script would be fine also . : )
Thanks
How to programmatically pin app to taskbar ?
How to programmatically pin app to taskbar ?
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: How to programmatically pin app to taskbar ?
What do you think about the systray ?
Re: How to programmatically pin app to taskbar ?
Apparently there is -> https://docs.microsoft.com/en-us/window ... to-taskbarvmars316 wrote:Is it possible to pin an app to taskbar programmatically ?
Don't ask me how to do that with PureBasic, though. I think that may be only for UWP apps, too.
Re: How to programmatically pin app to taskbar ?
Since you said a script would be OK, here's a PowerShell script (I haven't tested it) https://stackoverflow.com/questions/317 ... windows-10
You can run Powershell with RunProgramm and the "Hide"-Flag to hide from the user that you're using a Shell Script.
You can run Powershell with RunProgramm and the "Hide"-Flag to hide from the user that you're using a Shell Script.
Re: How to programmatically pin app to taskbar ?
Won't work in Windows 10 update x. It only returns the verb for pin (which is language specific) when it is requested from an application with the name Explorer.exe
They really wan't to prevent you doing this in code...
They really wan't to prevent you doing this in code...
Re: How to programmatically pin app to taskbar ?
Yes, Pin to Tasbar doesn't work the same way since windows 10 1809
Before it was possible to do it quite easily using vbscript, powershell... with the verb Pin to TaskBar
I developed a little while ago, in PB, a tool: PinUtil, with the help of JFX, for the need of my Win10XPE project
It uses MasqueradePEB Procedure
to gives the appearance of explorer.exe process and so the "pin to taskbar" item will show up in context menu, bypassing MS simple trick To hide it.
Idea from PowerShell-Suite Masquerade-PEB.ps1
Then it uses IID_IContextMenu to Invoke the Context Menu for the File and Browse the Menu Items
If the Name Matches the Verb, the Associate Command is Called
x64/x86 exe are here : https://github.com/ChrisRfr/PinUtil
Before it was possible to do it quite easily using vbscript, powershell... with the verb Pin to TaskBar
I developed a little while ago, in PB, a tool: PinUtil, with the help of JFX, for the need of my Win10XPE project
It uses MasqueradePEB Procedure
to gives the appearance of explorer.exe process and so the "pin to taskbar" item will show up in context menu, bypassing MS simple trick To hide it.
Idea from PowerShell-Suite Masquerade-PEB.ps1
Then it uses IID_IContextMenu to Invoke the Context Menu for the File and Browse the Menu Items
If the Name Matches the Verb, the Associate Command is Called
x64/x86 exe are here : https://github.com/ChrisRfr/PinUtil
Usage1: PinUtil (TaskBar|StartMenu) File ["File 2" "File 9"]
Ex1: PinUtil TaskBar %windir%\System32\calc.exe
Ex2: PinUtil StartMenu "C:\Windows\System32\notepad.exe" "%windir%\System32\calc.exe"
Usage2: PinUtil Config ConfigFile [Section (Default=PinUtil)]
Ex: PinUtil Config %windir%\System32\PintUtil.ini
PinUtil.ini Limited To 9 Elements For TaskBar And StartMenu:
[PinUtil]
StartMenu1=%AllPrograms%\Accessories\Paint.lnk
StartMenu0=%WinDir%\Explorer.exe
TaskBar0=%SystemRoot%\System32\cmd.exe
TaskBar9=%SystemRoot%\Explorer.exe
Usage3: Pecmd ConfigFile [SubSection (Default=PinUtil)] (_SUB SubSection)
Pecmd is a command interpreter commonly used in WinPE (Windows PE )
Ex: PinUtil Pecmd %windir%\System32\Pecmd.ini PinUtil
Pecmd.ini
_SUB PinUtil
PINT %AllPrograms%\Accessories\Paint.lnk,StartMenu
PINT %WinDir%\Explorer.exe,StartMenu
PINT %SystemRoot%\System32\cmd.exe,TaskBar
PINT %SystemRoot%\Explorer.exe,TaskBar
Environment Variables are Available As Well As:
%StartMenu%, %Programs%, %ALLPrograms%, %Desktop%, %QuickLaunch%
Support StartIsback, Start10, Start8, Open-Shell, Classic Shell, Explorer7ForWin8, Windows 7 StartMenu
You Cannot Pin Applications from a Removable Media...
Re: How to programmatically pin app to taskbar ?
Thanks , I'll take a look at PinUtil .
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."