Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin to taskbar not working on Windows 10 Build 1809 #23

Open
ckck2000 opened this issue Mar 16, 2019 · 6 comments
Open

Pin to taskbar not working on Windows 10 Build 1809 #23

ckck2000 opened this issue Mar 16, 2019 · 6 comments
Labels
M$ insanity Broken by Micro$oft insanity, i.e. probably *not* our fault!

Comments

@ckck2000
Copy link

Hello,

The plugin's ShellVerb.PinToTaskbar function doesn't work on Windows 10 Build 1809 (17763.379)
There was no problem on Windows 10 build 1803.

@lordmulder
Copy link
Owner

lordmulder commented May 5, 2019

Yeah, this seems to be a bug (or "intended behavior" they might say) in Windows 10 v1809 🙄

All I know is that finding the FolderItemVerb instance for the “Pin to taskbar” menu item still works fine in Windows 10 v1809, but then FolderItemVerb::DoIt() fails for no conclusive reason 😠 😠 😠

I think the returned error code is E_INVALIDARG (aka “One or more arguments are invalid”), which obviously makes absolutely no sense, as the DoIt() function does not take any arguments...

Regards.

@lordmulder lordmulder added the M$ insanity Broken by Micro$oft insanity, i.e. probably *not* our fault! label May 5, 2019
@gbelmont22
Copy link

I was just made aware my NSIS installs are no longer correctly pinning the shortcut to the taskbar and suspect this is the issue. I did some digging and found this article:

Pinning a network program with a Jump List to the taskbar programmatically in windows 10 – Part 1

The author describes the issue in Windoze 10 v1809 and outlines a methodology for fooling windows back into behaving itself. I think there is enough information presented that you might be able (if so inclined) to cobble together a work around in StdUtils using the same technique.

@lordmulder
Copy link
Owner

lordmulder commented Aug 22, 2019

Well, according to that article, the "solution" seems to be to rename your program to explorer.exe, in order to fool Windows – Windows apparently "blocks" all other processes now. I haven't tried that yet, but it probably is not feasible for most installers to be called explorer.exe. Also, the other approach, which is to manipulate the image path name, seems pretty awkward to me. This feels like defeating a "how braindead can they be to do that?" with an "oh, we really shouldn't be doing that" 😨

@gbelmont22
Copy link

gbelmont22 commented Aug 23, 2019

I agree manipulating the image path name is a bit of jigery-pokery, but unless I'm not getting it, I think it's a change to the PEB data in memory only (not the actual name of the file on the filesystem). So (again, if I am getting this right), the idea is to just quietly find the PEB in memory, tweak the image name to 'explorer.exe', execute the pin operation, return the name back to it's original value, and proceed like nothing bizarre ever happened. - Definitely not optimal, but (in my opinion) it could be a workable hack/solution... ymmv. BTW. StdUtils rocks. :-)

Update: Don't bother mate, this workaround no longer functions. It looks like it is also a victim of build 1809 or later. oh well...

@Nutzzz
Copy link

Nutzzz commented Apr 8, 2020

Note this feature could be revived based on the method that MS Edge is currently using (meaning it should stick around for a while). This from <https://geelaw.blog/entries/msedge-pins/>:

  1. Initialise COM.
  2. Use ILCreateFromPathW to get an absolute PIDL.
  3. Use CoCreateInstance to activate CLSID_TaskbandPin with interface IID_IPinnedList3.
  4. Use Modify method with the PIDL to pin/unpin the target.
  5. Release the interface, the PIDL and uninitialse COM.

You can get an example here under MIT license. Once compiled, use pin "C:\path\to\file.lnk" to pin a Shortcut, and pin "C:\path\to\file.lnk" u to unpin it.

@lordmulder
Copy link
Owner

lordmulder commented Apr 9, 2020

Thanks, will definitely have a look at that!

I think the crucial point is the availability of the, apparently undocumented, IID_IPinnedList3 interface.

Is it only available in latest Windows 10 or also in older OS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M$ insanity Broken by Micro$oft insanity, i.e. probably *not* our fault!
Projects
None yet
Development

No branches or pull requests

4 participants