otya128 / winevdm

16-bit Windows (Windows 1.x, 2.x, 3.0, 3.1, etc.) on 64-bit Windows
GNU General Public License v2.0
2.68k stars 152 forks source link

Can't pin 16-bit application to task bar #656

Open medasaro opened 4 years ago

medasaro commented 4 years ago

To reproduce: 1) Open a 16-bit windows application in winevdm 2) Right click on the application's icon in the taskbar 3) Select "Pin to taskbar" 4) Close the 16-bit application 5) Click on the newly created icon on the taskbar

Expected behavior: The application launches

Actual behavior: winevdm launches and asks for the location of a .EXE file.

Platform: Windows 10 Pro

-Matthew D'Asaro

cracyc commented 4 years ago

This doesn't work for ntvdm either but maybe ideas can be found with java programs like https://stackoverflow.com/questions/1834599/pinning-a-java-application-to-the-windows-7-taskbar .

otya128 commented 4 years ago

Setting PKEY_AppUserModel_RelaunchCommand and PKEY_AppUserModel_RelaunchDisplayNameResource works, but the icon disappears. Setting PKEY_AppUserModel_RelaunchIconResource will show the icon, but it's a nasty issue because the icon needs to be saved to a file.

medasaro commented 4 years ago

Looking at how 32-bit applications behave when pinned, it appears that the icon that is in the task bar is the icon associated with the executable file not the icon that the application's main window has. So we should be able to extract the icon from the application executable and use that for the task bar icon when pinned.

-Matthew

cracyc commented 4 years ago

Trouble is the program doesn't know when something is pinned so every win16 window would have to get it's icon extracted. A compromise might be to see if progman dde already saved an icon when the program was installed and use that otherwise just use a default icon.

leecher1337 commented 4 years ago

This problem has been plaguing users since, I think, Windows 7, even on 32bit version. Microsoft for some reason removed their 16bit Icon parsing support (iirc they claimed that it was for security reasons) from the PrivateExtractIconsW API function. I updated the NTVDMx64 loader code https://github.com/leecher1337/ntvdmx64/commit/9b966f587023e5c2e36270cdad895ec12ecc8e13 so that 16bit Icon support can be restored in Windows. If you install the most recent NTVDMx64 loader, you can work around the bug with it. The compiled version of the updated loaders is available in my github repository, as you can see.

Anixx commented 4 years ago

Winevdm extracts icons upon installation just well. As well as in runtime.

magiblot commented 4 years ago

This problem has been plaguing users since, I think, Windows 7, even on 32bit version. Microsoft for some reason removed their 16bit Icon parsing support (iirc they claimed that it was for security reasons) from the PrivateExtractIconsW API function.

The official point of view on this seems to be this one: http://technet.microsoft.com/en-us/magazine/cc462815.aspx