changeset 17050:e780fb37168b

win32: specify _CREATE_NO_WINDOW on spawndetached() Before this change, a console window briefly popped up on "hg serve -d" and disappeared again, stealing the focus window (which was very annyoing when running tests). Specifying _CREATE_NO_WINDOW instead of _DETACHED_PROCESS fixes this (as tested on Windows 7 x64).
author Adrian Buehlmann <adrian@cadifra.com>
date Mon, 25 Jun 2012 19:11:29 +0200
parents 3dd6da761fff
children c5ed575f3137
files mercurial/win32.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/win32.py	Wed Jun 27 02:34:58 2012 +0200
+++ b/mercurial/win32.py	Mon Jun 25 19:11:29 2012 +0200
@@ -97,7 +97,7 @@
                 ('dwProcessId', _DWORD),
                 ('dwThreadId', _DWORD)]
 
-_DETACHED_PROCESS = 0x00000008
+_CREATE_NO_WINDOW = 0x08000000
 _STARTF_USESHOWWINDOW = 0x00000001
 _SW_HIDE = 0
 
@@ -337,7 +337,7 @@
     args = comspec + " /c " + args
 
     res = _kernel32.CreateProcessA(
-        None, args, None, None, False, _DETACHED_PROCESS,
+        None, args, None, None, False, _CREATE_NO_WINDOW,
         env, os.getcwd(), ctypes.byref(si), ctypes.byref(pi))
     if not res:
         raise ctypes.WinError