<div dir="ltr"><div dir="ltr">I've checked: it's a one liner to be changed in <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c</a> near line 826</div><div>Since this is generated code from VMMaker, the code has to be changed in slang.</div><div>IMO, there should be a boolean argument (optional) telling if we want to open the console or not.</div><div>IMO false by default would be a good thing, though true for backward compatibility is also a possible alternative...<br></div></div><br><div class="gmail_quote"><div dir="ltr">Le mar. 11 déc. 2018 à 12:56, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>It is possible, ask stack overflow</div><div><a href="https://stackoverflow.com/questions/4743559/how-to-execute-child-console-programs-without-showing-the-console-window-from-th" target="_blank">https://stackoverflow.com/questions/4743559/how-to-execute-child-console-programs-without-showing-the-console-window-from-th</a><br></div><div><a href="https://stackoverflow.com/questions/18841971/hide-console-window-while-running-a-command-through-c?r=SearchResults" target="_blank">https://stackoverflow.com/questions/18841971/hide-console-window-while-running-a-command-through-c?r=SearchResults</a></div><div><br></div><div>I've recently "fixed" my own script in Visualworks so as to use these low level API (already procided by VW)<br></div><div><br></div><div>      BOOL CreateProcessW(<br>                    LPCWSTR imageName,<br>                    LPCWSTR commandLine,<br>                    struct SECURITY_ATTRIBUTES *pSecurity,<br>                    struct SECURITY_ATTRIBUTES *tSecurity,<br>                    BOOL inheritHandles,<br>                    DWORD creationFlags,<br>                    LPVOID environment,<br>                    LPWSTR currentDirectoryName,<br>                    struct STARTUPINFO *startupInfo,<br>                    struct PROCESS_INFORMATION *processInfo)</div><div><br></div><div>First argument is fullpath to cmd.exe (take it from environment variable 'ComSpec')</div><div>Second argument is '/u /c ' ,  'your command here encoded in utf16'</div><div>Security arguments are nil and nil</div><div>
inheritHandles is true</div><div>creationFlags is zero<br></div><div>environment is nil</div><div>
currentDirectoryName is nil</div><div><br></div><div>startupInfo is more involved: it must be used to pass the pair of pipes (handles) for input/output:</div><div>struct STARTUPINFO {<br>            DWORD    cb;<br>            LPTSTR        lpReserved;<br>            LPTSTR        lpDesktop;<br>            LPTSTR        lpTitle;<br>            DWORD        dwX;<br>            DWORD        dwY;<br>            DWORD        dwXSize;<br>            DWORD        dwYSize;<br>            DWORD        dwXCountChars;<br>            DWORD        dwYCountChars;<br>            DWORD        dwFillAttribute;<br>            DWORD        dwFlags;<br>            WORD        wShowWindow;<br>            WORD        cbReserved2;<br>            LPBYTE        lpReserved2;<br>            HANDLE    hStdInput;<br>            HANDLE    hStdOutput;<br>            HANDLE    hStdError;<br></div><div>}</div><div><br></div><div>You initialize it with void GetStartupInfoW(LPSTARTUPINFO lpStartupInfo)</div><div>IMPORTANT: set 
wShowWindow to 0,</div><div>and then pass the input/output/error handles in last three fields.</div><div><br></div><div>processInfo will contain information on output and must be allocated</div><div>struct PROCESS_INFORMATION {<br>            HANDLE hProcess;<br>            HANDLE hThread;<br>            DWORD dwProcessId;<br>            DWORD dwThreadId;<br>        }</div><div><br></div><div>you can then get exit status thru BOOL GetExitCodeProcess call, close the pipes, etc...<br></div><div><br></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">Le mar. 11 déc. 2018 à 10:08, Christopher Fuhrman <<a href="mailto:christopher.fuhrman@inria.fr" target="_blank">christopher.fuhrman@inria.fr</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Peter. That looks like a cool package. I guess I will live with it for now, because I don't want to code too much of a platform-specific solution (yet). </div><br><div class="gmail_quote"><div dir="ltr">On Mon, 10 Dec 2018 at 21:16, Peter Uhnak <<a href="mailto:i.uhnak@gmail.com" target="_blank">i.uhnak@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">This is normal (and much lamented) behavior of cmd. There's <a href="https://github.com/astares/Pharo-OS-Windows" target="_blank">https://github.com/astares/Pharo-OS-Windows</a> which implements parts of the WinAPI... with which one can create headless windows. (I think it should be also available in the catalog).</div><div dir="ltr"><br></div><div dir="ltr">Peter<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 10, 2018 at 11:47 AM Christopher Fuhrman <<a href="mailto:christopher.fuhrman@inria.fr" target="_blank">christopher.fuhrman@inria.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>My Git data mining API in Pharo 6.1 uses "LibC uniqueInstance system: 'some commands'" which has an annoying side effect of popping up a window (which steals the GUI focus in Windows 10). Maybe it's the same on MacOS and Linux?</div><div><br></div><div>As such, I can't use my Windows PC to do anything else when the mining process is running (it can take several minutes). I'm not able to use Pharo's OSProcess or OSSubprocess because they don't support Windows (yet?).</div><div><br></div><div>I tried creating a separate Windows Desktop (feature of Windows 10), but the CMD.EXE window manages to pop up there, too - almost seems like a windows bug.</div><div><br></div><div>Does anyone know of a way to have the LibC window not pop up?<br></div><div><br></div><div>Cheers,</div><div><br></div><div>Christopher</div></div>
</blockquote></div></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>