gpt4 book ai didi

c++ - Chromium Embedded 如何检测我们是否作为子进程运行?

转载 作者:行者123 更新时间:2023-11-30 03:55:47 25 4
gpt4 key购买 nike

当为 Chromium Embedded Framework 3 子进程使用单个可执行文件时,程序如何检测它是作为主可执行文件还是作为子进程运行?

我发现主进程使用命令行开关 --type=zygote 运行,但子进程不是。

是否总是正确的(用伪语言):

if (command line switch --type=zygote not found) {
we are in subprocess
}

?

最佳答案

是的,我相信是这样,我们成功地使用了该技术。

          if ( wcsstr(lpCmdLine, L"type") == NULL ){
// we have no subprocess type so we are the main process
}

关于c++ - Chromium Embedded 如何检测我们是否作为子进程运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28894146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com