diff options
-rw-r--r-- | lib/pure/osproc.nim | 10 | ||||
-rw-r--r-- | lib/windows/winlean.nim | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index fa20afff0..9929abb95 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -30,13 +30,14 @@ type ## variable. ## On Windows, this is the default. poEvalCommand, ## Pass `command` directly to the shell, without quoting. - ## Use it only if `command` comes from trused source. + ## Use it only if `command` comes from trusted source. poStdErrToStdOut, ## merge stdout and stderr to the stdout stream poParentStreams, ## use the parent's streams - poInteractive ## optimize the buffer handling for responsiveness for + poInteractive, ## optimize the buffer handling for responsiveness for ## UI applications. Currently this only affects ## Windows: Named pipes are used so that you can peek ## at the process' output streams. + poDemon ## Windows: The program creates no Window. ProcessObj = object of RootObj when defined(windows): @@ -523,8 +524,9 @@ when defined(Windows) and not defined(useNimRtl): var tmp = newWideCString(cmdl) var ee = newWideCString(e) var wwd = newWideCString(wd) - success = winlean.createProcessW(nil, - tmp, nil, nil, 1, NORMAL_PRIORITY_CLASS or CREATE_UNICODE_ENVIRONMENT, + var flags = NORMAL_PRIORITY_CLASS or CREATE_UNICODE_ENVIRONMENT + if poDemon in options: flags = flags or CREATE_NO_WINDOW + success = winlean.createProcessW(nil, tmp, nil, nil, 1, flags, ee, wwd, si, procInfo) else: success = winlean.createProcessA(nil, diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim index 89d86c62a..4962186fb 100644 --- a/lib/windows/winlean.nim +++ b/lib/windows/winlean.nim @@ -115,6 +115,8 @@ const SYNCHRONIZE* = 0x00100000'i32 FILE_FLAG_WRITE_THROUGH* = 0x80000000'i32 + CREATE_NO_WINDOW* = 0x08000000'i32 + proc closeHandle*(hObject: Handle): WINBOOL {.stdcall, dynlib: "kernel32", importc: "CloseHandle".} |