Guido Franzke
2010-02-09 19:39:10 UTC
Hello NG,
I start a process with CreateProcess. The called exe is a Win32 App that is
run in a dos console. So CreateProcess opens the DOS console window.
But I don't want show the DOS window or I want show it minimized.
So I made following:
STARTUPINFO startupInfo;
PROCESS_INFORMATION processInfo;
GetStartupInfo( &startupInfo );
startupInfo.dwFlags |= STARTF_USESHOWWINDOW;
//startupInfo.wShowWindow=0; // Don't show DOS window
startupInfo.wShowWindow=SW_SHOWMINIMIZED; // minimize DOS window
DWORD dwCreate = NORMAL_PRIORITY_CLASS;
if (!CreateProcess("opt.exe",NULL,NULL,NULL,TRUE,dwCreate,NULL,NULL,
&startupInfo,&processInfo))
{
return false;
}
//DWORD pidOptim = processInfo.dwProcessId;
But the DOS window is not minimized (nor not shown although I have
ShowWindow=0).
Do you know, where is the mistake?
Another solution is to change my Win32 application. But what function is
used to get the window handle hWnd in my Win32 app's _tmain() to use in
ShowWindow(hWnd, SW_SHOWMINIMIZED)?
Thanks for help,
Guido
I start a process with CreateProcess. The called exe is a Win32 App that is
run in a dos console. So CreateProcess opens the DOS console window.
But I don't want show the DOS window or I want show it minimized.
So I made following:
STARTUPINFO startupInfo;
PROCESS_INFORMATION processInfo;
GetStartupInfo( &startupInfo );
startupInfo.dwFlags |= STARTF_USESHOWWINDOW;
//startupInfo.wShowWindow=0; // Don't show DOS window
startupInfo.wShowWindow=SW_SHOWMINIMIZED; // minimize DOS window
DWORD dwCreate = NORMAL_PRIORITY_CLASS;
if (!CreateProcess("opt.exe",NULL,NULL,NULL,TRUE,dwCreate,NULL,NULL,
&startupInfo,&processInfo))
{
return false;
}
//DWORD pidOptim = processInfo.dwProcessId;
But the DOS window is not minimized (nor not shown although I have
ShowWindow=0).
Do you know, where is the mistake?
Another solution is to change my Win32 application. But what function is
used to get the window handle hWnd in my Win32 app's _tmain() to use in
ShowWindow(hWnd, SW_SHOWMINIMIZED)?
Thanks for help,
Guido