M
M
mrZurg2015-05-25 00:33:58
Programming
mrZurg, 2015-05-25 00:33:58

How to associate files with an application and open it with this application (instead of another)?

In general, I did the following for file association:

"HKEY_CLASSES_ROOT/.ext/." = "nameApplication"
"HKEY_CLASSES_ROOT/nameApplication/shell/open/command/." = "путь к application.exe"

In the registry, I "create" my ext extension, "connect" it to the nameApplication identifier, and determine the path to the exe.
Everything seems to be fine, but:
How to remove the current association?
I'm trying to remove:
HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts/.aed/UserChoice

But you need administrator rights for such an operation, and still restart explorer.exe.
Therefore, if before that I opened the file with another program, I have to click on the desired file - properties / change / (select my application) / apply
And how can I do without restarting explorer.exe?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Pukhov, 2015-05-25
@mrZurg

After changing the registry, you need to send a signal to the system "update associations", here is an excerpt from Google "Microsoft documents that the official procedure for creating file associations is through modification of the registry. The only other API you need to call is SHChangeNotify, with SHCNE_ASSOCCHANGE, to tell running applications that associations have changed." need to google in that direction

S
SagePtr, 2015-05-25
@SagePtr

https://msdn.microsoft.com/en-us/library/windows/d... (v=vs.85).aspx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question