1 Star 0 Fork 1

iqxg/nssm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
console.cpp 829 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include "nssm.h"
/* See if we were launched from a console window. */
bool check_console() {
/* If we're running in a service context there will be no console window. */
HWND console = GetConsoleWindow();
if (! console) return false;
unsigned long pid;
if (! GetWindowThreadProcessId(console, &pid)) return false;
/*
If the process associated with the console window handle is the same as
this process, we were not launched from an existing console. The user
probably double-clicked our executable.
*/
if (GetCurrentProcessId() != pid) return true;
/* We close our new console so that subsequent messages appear in a popup. */
FreeConsole();
return false;
}
void alloc_console(nssm_service_t *service) {
if (service->no_console) return;
AllocConsole();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iqxg/nssm.git
git@gitee.com:iqxg/nssm.git
iqxg
nssm
nssm
master

搜索帮助