Huntrods
Huntrods

Reputation: 2561

How to have my Win32 program 'pin to taskbar'?

I've written a small Win32 program in C which compiles and runs exactly as designed except for one thing...

When I run the program, the icon appears in the taskbar as expected. However, I cannot 'right click' on the running icon and select 'pin this program to the taskbar' - that option does not appear. The only right click option I have is to close the program.

How does one create a win32 program that allows the 'pin to taskbar' option?

Upvotes: 3

Views: 782

Answers (2)

Huntrods
Huntrods

Reputation: 2561

Credit for this answer goes to Okkaaj.

To pin a win32 compiled executable to the taskbar, the executable file must reside on a local hard drive. Executing from a remote network drive prevents the file from being pinned to the taskbar.

Upvotes: 3

Okkaaj
Okkaaj

Reputation: 125

I would have commented, but because I don't have 50 reputation - I had to make an answer.

I don't believe it's because of your application. I just made a simple Win32 C application, and the pinning works just fine. Try to check under this registry key: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer] and delete the entry "NoPinningToTaskbar" if it's present. Although if your applications name is any of the names mentioned in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileAssociation\AddRemoveNames it might be the reason it cannot be pinned. Hopefully you can get it solved.

Upvotes: 2

Related Questions