[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Getting rid of an annoying popup command window

From: Valik <vampire.valik.ml_at_gmail.com>
Date: 2006-05-24 18:59:59 CEST

Stefan Küng wrote:
> On 5/24/06, Valik <vampire.valik.ml@gmail.com> wrote:
>
>> Sure you can, at least as long as you are in control of the call to
>> CreateProcess(). Specify the SW_HIDE flag in the STARTUPINFO structure
>
> For console processes, that simply means that the window is is
> minimized. You can't completely hide console windows.
>
> Stefan
>

Explain the program below, then. Run it a time or two and look in Task
Manger and you'll see "cmd.exe" (or equivalent) running but you won't
see any command windows.

#include <Windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR
lpCmdLine, int nCmdShow)
{
        PROCESS_INFORMATION pi;
        STARTUPINFO si;
        memset(&si, 0, sizeof(si));
        si.cb = sizeof(si);
        si.dwFlags = STARTF_USESHOWWINDOW;
        si.wShowWindow = SW_HIDE;
        char szBuffer[MAX_PATH + 1];
        GetEnvironmentVariable("COMSPEC", szBuffer, MAX_PATH);
        CreateProcess(szBuffer, NULL, NULL, NULL, FALSE, NULL, NULL, NULL, &si,
&pi);
        return 0;
}

-- 
- Valik
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Wed May 24 19:00:12 2006

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.