microsoft / Windows-classic-samples

This repo contains samples that demonstrate the API used in Windows classic desktop applications.
Other
5.02k stars 3.21k forks source link

Some examples are no longer working on Windows 11 #250

Open Jeanmilost opened 2 years ago

Jeanmilost commented 2 years ago

Some examples are no longer working on Windows 11, among others:

They compile and run, but the registry part doesn't work at all. For example, no verb is visible in the context menu when you right click on a .txt file after compiling and running the DropTargetVerb example, or after you registered the DLL generated with the ExplorerCommandVerb example.

Either you should clearly notify that these examples no longer working on Windows 11, and redirect to working equivalent examples, or you should modify these examples to consider the Windows 11 specificities.

Thank you to correct that.

Jeanmilost commented 2 years ago

NOTE after further testing, I noticed that the issue happens because Windows 11 associates the file formats used by the above mentioned demos with some default applications provided by the system, which take precedence over the keys registered by these demos. This give the impression that they are not working, although the issue is in fact somewhere else.

I would suggest to at least add code to test the following key (or the key relative to the file format used in the demo):

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ .txt\UserChoice

and if the Progid value contained in it isn't set to txtfile, at least notify the user about the issue, and give instructions about how to resolve that.