Click here to Skip to main content
15,892,480 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hide the cmd window using createprocess function Pin
0x3c09-Mar-09 21:17
0x3c09-Mar-09 21:17 
GeneralRe: Hide the cmd window using createprocess function Pin
raj15769-Mar-09 21:27
raj15769-Mar-09 21:27 
GeneralRe: Hide the cmd window using createprocess function Pin
0x3c010-Mar-09 6:17
0x3c010-Mar-09 6:17 
AnswerRe: Hide the cmd window using createprocess function Pin
Hamid_RT9-Mar-09 21:44
Hamid_RT9-Mar-09 21:44 
GeneralRe: Hide the cmd window using createprocess function Pin
raj15769-Mar-09 21:50
raj15769-Mar-09 21:50 
GeneralRe: Hide the cmd window using createprocess function Pin
Hamid_RT9-Mar-09 21:54
Hamid_RT9-Mar-09 21:54 
AnswerRe: Hide the cmd window using createprocess function Pin
KarstenK10-Mar-09 0:17
mveKarstenK10-Mar-09 0:17 
AnswerRe: Hide the cmd window using createprocess function Pin
KEL320-Aug-09 3:03
KEL320-Aug-09 3:03 
Your problem is in the Flags:
sInfo.dwFlags = STARTF_USESHOWWINDOW;

PROCESS_INFORMATION pInfo;
STARTUPINFOA sInfo;
sInfo.cb = sizeof(STARTUPINFOA);
sInfo.lpReserved = NULL;
sInfo.lpReserved2 = NULL;
sInfo.cbReserved2 = 0;
sInfo.lpDesktop = NULL;
sInfo.lpTitle = NULL;
sInfo.dwFlags = STARTF_USESHOWWINDOW;
sInfo.dwX = 0;
sInfo.dwY = 0;
sInfo.dwFillAttribute = 0;
sInfo.wShowWindow = SW_HIDE;

BOOL ret = ::CreateProcess(m_PathToExe, lpExePlusArgs, NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pInfo);

if(ret)
{
    // Wait until application has terminated
    WaitForSingleObject(pInfo.hProcess, INFINITE);

    // Close process and thread handles
    ::CloseHandle(pInfo.hThread);
    ::CloseHandle(pInfo.hProcess);
}


Read MSDN carefully and with patience.

kostas KEL

QuestionUnhandled exception in MyApp.exe (KERNEL.dll): 0xE06D7363: Microsoft C++ exception Pin
puppya9-Mar-09 21:04
puppya9-Mar-09 21:04 
AnswerRe: Unhandled exception in MyApp.exe (KERNEL.dll): 0xE06D7363: Microsoft C++ exception Pin
Cedric Moonen9-Mar-09 21:35
Cedric Moonen9-Mar-09 21:35 
AnswerRe: Unhandled exception in MyApp.exe (KERNEL.dll): 0xE06D7363: Microsoft C++ exception Pin
Hamid_RT9-Mar-09 21:38
Hamid_RT9-Mar-09 21:38 
AnswerRe: Unhandled exception in MyApp.exe (KERNEL.dll): 0xE06D7363: Microsoft C++ exception Pin
KarstenK10-Mar-09 2:09
mveKarstenK10-Mar-09 2:09 
Questionget keynames and values from INIfile Pin
siva4559-Mar-09 20:52
siva4559-Mar-09 20:52 
AnswerRe: get keynames and values from INIfile Pin
David Crow10-Mar-09 3:49
David Crow10-Mar-09 3:49 
QuestionDATABASE W ITH MFC Pin
hrishiS9-Mar-09 20:20
hrishiS9-Mar-09 20:20 
AnswerRe: DATABASE W ITH MFC Pin
Hamid_RT9-Mar-09 20:22
Hamid_RT9-Mar-09 20:22 
GeneralRe: DATABASE W ITH MFC Pin
hrishiS9-Mar-09 21:43
hrishiS9-Mar-09 21:43 
GeneralRe: DATABASE W ITH MFC Pin
David Crow10-Mar-09 3:54
David Crow10-Mar-09 3:54 
QuestionCView problem Pin
prithaa9-Mar-09 20:19
prithaa9-Mar-09 20:19 
AnswerRe: CView problem Pin
Code-o-mat9-Mar-09 22:51
Code-o-mat9-Mar-09 22:51 
GeneralRe: CView problem Pin
prithaa9-Mar-09 23:47
prithaa9-Mar-09 23:47 
QuestionCan I change defined value or const value? Pin
z01e9-Mar-09 20:17
z01e9-Mar-09 20:17 
AnswerRe: Can I change defined value or const value? Pin
Hamid_RT9-Mar-09 20:20
Hamid_RT9-Mar-09 20:20 
AnswerRe: Can I change defined value or const value? Pin
Cedric Moonen9-Mar-09 21:42
Cedric Moonen9-Mar-09 21:42 
AnswerRe: Can I change defined value or const value? Pin
Iain Clarke, Warrior Programmer10-Mar-09 1:07
Iain Clarke, Warrior Programmer10-Mar-09 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.