Click here to Skip to main content
16,012,045 members

Comments by Member 11768554 (Top 2 by date)

Member 11768554 8-Oct-16 3:05am View    
BOOL fsuccess=CreateProcess(NULL,//lpApplicationName
pathexe, //lpCommanderLine
NULL, //lpProcessAttributes
NULL, //lpThreadAttributes
FALSE, //bInheritHandles
NORMAL_PRIORITY_CLASS,//dwCreationFlags
NULL, //lpEnvironment
NULL, //lpCurrentDirectory
&sinfo, //lpStartupInfo
&pinfo); //lpProcessInformation
// wait for NotePad finishes
if(fsuccess)
{
HANDLE hProcess=pinfo.hProcess;
CloseHandle(pinfo.hThread);// close thread at once
if (bWait)
{
DWORD dw = WaitForSingleObject(hProcess,INFINITE);
if (dw !=WAIT_FAILED)
{
DWORD dwExitCode;
GetExitCodeProcess(hProcess,&dwExitCode);
if (dwExitCode==STILL_ACTIVE) AfxMessageBox("IDS_NOTEPAD_ALIVE");
}
}

CloseHandle(pinfo.hProcess);
}


when I debug "DWORD dw = WaitForSingleObject(hProcess,INFINITE);" . it will wait infinite, though another program open sucessfully. When I close loading program, it can goto next line.
Member 11768554 16-Jun-15 5:24am View    
if(DesignMode) return;
What is DesignMode? How can I do this, in my project?