Re: CreateProcess leaves child windows on rear
- From: "AliR \(VC++ MVP\)" <AliR@xxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 15:09:12 GMT
The problem is not in this code. What do you do after this code?
By the way I would use GetWindowsDirectory() instead of hard coding
C:\Windows
AliR.
<hq4000@xxxxxxxxxxx> wrote in message
news:1174401801.472849.27650@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
After build the following code as test.exe. The test.exe starts the
notepad.exe ok, but it has the notepad.exe window stays behind an
active window if there is any. How can I ensure the notepad.exe is
created stays on the front of other active window?
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
ZeroMemory( &ProcessInformation, sizeof( ProcessInformation ) );
ZeroMemory( &StartupInfo, sizeof( StartupInfo ) );
StartupInfo.cb = sizeof( STARTUPINFO );
StartupInfo.dwFlags = CREATE_NEW_CONSOLE;
FolderPath[0] = _T('\0');
CommandString[0] = _T('\0');
StringCchCatW(FolderPath, MAX_PATH,_T("C:\\Windows"));
StringCchCatW(CommandString, MAX_PATH, _T("C:\\Windows\
\Notepad.exe"));
CreateProcess(NULL,
CommandString,
NULL,
NULL,
TRUE,
0,
NULL,
FolderPath,
&StartupInfo,
&ProcessInformation );
...
}
.
- Follow-Ups:
- Re: CreateProcess leaves child windows on rear
- From: hq4000@xxxxxxxxxxx
- Re: CreateProcess leaves child windows on rear
- References:
- CreateProcess leaves child windows on rear
- From: hq4000@xxxxxxxxxxx
- CreateProcess leaves child windows on rear
- Prev by Date: Re: error c2664 - DDX with bool-array
- Next by Date: Re: How can I create Excel (.xls) files?
- Previous by thread: CreateProcess leaves child windows on rear
- Next by thread: Re: CreateProcess leaves child windows on rear
- Index(es):
Relevant Pages
|