Reputation: 1
I have an app that will usually be spawned by another app. The UI and behaviour will vary a bit depending on whether the said app was opened directly by the user or spawned. How can I determine if it was launched by the user or spawned?
I have a couple of ideas but they don't seem doable.
If there was a way of sending extra app specific param via CreateProcess() this would be simple but I can't find how to do that.
If I can find the handle of the parent process, I can determine if it was spawned or not but I can't see how to do that.
Please help!
Upvotes: 0
Views: 109
Reputation: 175986
If there was a way of sending extra app specific param via CreateProcess()
So you have control of the invoking application? If so surely this is what command lines are for?
CreateProcess( NULL, "C:\\app.exe /launched_by_app2" ...)
Upvotes: 1