Commit 718709de authored by captainwong's avatar captainwong

create process withou any window ok

parent 56bec381
...@@ -75,7 +75,8 @@ inline DWORD daemon(const std::wstring& path, bool wait_app_exit = true, bool sh ...@@ -75,7 +75,8 @@ inline DWORD daemon(const std::wstring& path, bool wait_app_exit = true, bool sh
si.dwFlags |= STARTF_USESHOWWINDOW; si.dwFlags |= STARTF_USESHOWWINDOW;
si.wShowWindow = show ? SW_SHOW : SW_HIDE; si.wShowWindow = show ? SW_SHOW : SW_HIDE;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
BOOL bRet = CreateProcessW(NULL, (LPWSTR)(path.c_str()), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); DWORD dwCreationFlags = show ? 0 : CREATE_NO_WINDOW;
BOOL bRet = CreateProcessW(NULL, (LPWSTR)(path.c_str()), NULL, NULL, FALSE, dwCreationFlags, NULL, NULL, &si, &pi);
if (bRet) { if (bRet) {
WaitForSingleObject(pi.hProcess, wait_app_exit ? INFINITE : 0); WaitForSingleObject(pi.hProcess, wait_app_exit ? INFINITE : 0);
DWORD dwExit; DWORD dwExit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment