added poDemon flag for process management

This commit is contained in:
Araq
2015-10-19 16:08:31 +02:00
parent 1f3e473529
commit c977daf9d8
2 changed files with 8 additions and 4 deletions

View File

@@ -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,

View File

@@ -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".}