开发者

about a process and the process that spawns it (win32/C)

开发者 https://www.devze.com 2023-03-01 04:43 出处:网络
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

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.

  1. If there was a way of sending extra app 开发者_如何学Pythonspecific param via CreateProcess() this would be simple but I can't find how to do that.

  2. 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!


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" ...)
0

精彩评论

暂无评论...
验证码 换一张
取 消