In Windows, how can I give other applications the ability to programmatically launch my application?

StackOverflow https://stackoverflow.com/questions/20644962

  •  19-09-2022
  •  | 
  •  

Question

I've written a Windows application. I want other applications to be able to programmatically launch my application. How can I achieve that and what are the considerations involved?

Edit: To clarify, I'm not asking how other applications can launch my application; I'm asking what I can do to ensure that other applications are able to launch my application.

Was it helpful?

Solution

To be able to launch an application without having to know the explicit path to where it is installed, you need to register it with Windows by adding it to the App Paths registry tree.

This is typically done during application installation.

See MSDN - Application Registration

OTHER TIPS

In Windows, there is no security preventing an application from running another application (in user mode at least, to run in admin mode would require the other program to be executed in admin mode, or else to prompt the user to run it in admin mode). The other application simply needs to know the path to the location of your .exe file and it can execute it. If the other program doesn't know the exact path, but it knows where to look and what your program .exe is called, it can search for it in the file system before executing it as well.

As for specifically how they would launch your program's .exe file, this will depend on the the language their program is written in as to how the system API to launch the .exe is called.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top