Open the file with the associated application if there is an app opened, bring it to the frontend, and open the file.
I wrote an app associated with specified file extensions. Double click the extension file and launch the app through registry
# location HKEY_CLASSES_ROOT\MyApp.Bif\shell\open\command
"C:\Users\alpha\AppData\Roaming\MyCompany\MyApp.exe" "%1"
Now I hope the file can be opened by an opened application. Then bring the app to the front end and be focused.
The only way I thought is:
- open a new app.
- check is there any opened app?
- if no, open the file.
- if yes, notify it to open the file, close itself.
- notify it: tcp? namedpipe?
There is a common function, is there any direct method?
Thanks in advance.