How to double-click a file in Explorer?

When a user double-clicks a file to launch it, I need to perform a custom action if the file meets certain criteria.

On WindowsXP, you can use ShellExecuteEx workarounds in explorer.exe, and the file name was available. I need to do something similar in Windows 7 and 8.

How can I execute some code when double-clicking files and have the file name?

I need a method that will continue to work if updating Windows Updates patches.

+4
source share
4 answers

procmon , , ( ). Explorer HKCR\*\ShellEx\DataHandler.

DataHandler Windows.

, , , , .

" " , , : DataHandler HKCR\*\ShellEx\DataHandler GUID CLSID dll, . , "" . , :

IPersistFile. (CLSID) .

, dll, , , .

​​dll (, ), , .

+8

, , , ? /? - filters ( XP). - , !

, API-. MSDN:

enter image description here

, "Minifilter A"? , , !

+4

, . - -, SHELL32!CExecuteApplication::Execute , . . , CreateProcess. , . CreateProcess , , , MS Outlook. , .

+2

, . shellexecuteex . Windows 7, kernel32.dll ntdll, API . . , . , . , , , . , , , .

+2
source

Source: https://habr.com/ru/post/1540408/


All Articles