关于进程和生成它的进程 (win32/C)
我有一个应用程序,通常会由另一个应用程序生成。 UI 和行为会略有不同,具体取决于所述应用程序是由用户直接打开还是生成。我如何确定它是由用户启动还是衍生?
我有几个想法,但它们似乎不可行。
如果有一种方法可以通过 CreateProcess() 发送额外的应用程序特定参数,这会很简单,但我找不到如何做到这一点。
如果我可以找到父进程的句柄,我可以确定它是否已生成,但我不知道如何做到这一点。
请帮忙!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那么您可以控制调用应用程序吗?如果是的话,这肯定是命令行的用途吗?
So you have control of the invoking application? If so surely this is what command lines are for?