Click here to Skip to main content
15,899,474 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish3-Oct-04 19:24
Kiran Satish3-Oct-04 19:24 
GeneralRe: How to start another application and run it within another application Pin
Muhammad Azam3-Oct-04 23:22
Muhammad Azam3-Oct-04 23:22 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish4-Oct-04 7:02
Kiran Satish4-Oct-04 7:02 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish4-Oct-04 7:14
Kiran Satish4-Oct-04 7:14 
GeneralRe: How to start another application and run it within another application Pin
Muhammad Azam4-Oct-04 21:44
Muhammad Azam4-Oct-04 21:44 
GeneralRe: How to start another application and run it within another application Pin
Kiran Satish5-Oct-04 14:11
Kiran Satish5-Oct-04 14:11 
GeneralRe: How to start another application and run it within another application Pin
Muhammad Azam5-Oct-04 20:24
Muhammad Azam5-Oct-04 20:24 
GeneralExitProcess Pin
elephantstar28-Sep-04 12:58
elephantstar28-Sep-04 12:58 
I opened a Word document using CreateProcess but how do I close or exit the process? I know I need to use ExitProcess(UINT exitcode) but how to I obtain the exitcode. Below is a sample of my code. Thanks!
----------------------------------------------------------------
void OpenFile()
{
char str[300];
DWORD dwExitCode;

STARTUPINFO stStartUpInfo;
PROCESS_INFORMATION pProcessInfo;

memset(&stStartUpInfo, 0, sizeof(STARTUPINFO));
stStartUpInfo.cb = sizeof(STARTUPINFO);
stStartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
stStartUpInfo.wShowWindow = SW_SHOWDEFAULT;
stStartUpInfo.dwXSize = STARTF_USESIZE;
stStartUpInfo.dwYSize = STARTF_USESIZE;

CreateProcess(NULL, str, NULL, NULL, FALSE,NORMAL_PRIORITY_CLASS, NULL,
NULL, &stStartUpInfo, &pProcessInfo);

GetExitCodeProcess(pProcessInfo.hProcess, &dwExitCode);
}

void CloseFile()
{
....code...
ExitProcess(dwExitCode);
}
GeneralRe: ExitProcess Pin
Antti Keskinen28-Sep-04 18:01
Antti Keskinen28-Sep-04 18:01 
GeneralRe: ExitProcess Pin
elephantstar29-Sep-04 7:23
elephantstar29-Sep-04 7:23 
GeneralInvalid CTempWnd problem Pin
PJ Arends28-Sep-04 12:57
professionalPJ Arends28-Sep-04 12:57 
GeneralRe: Invalid CTempWnd problem Pin
Antti Keskinen28-Sep-04 18:08
Antti Keskinen28-Sep-04 18:08 
GeneralRe: Invalid CTempWnd problem Pin
PJ Arends29-Sep-04 6:21
professionalPJ Arends29-Sep-04 6:21 
GeneralRe: Invalid CTempWnd problem Pin
Antti Keskinen29-Sep-04 6:40
Antti Keskinen29-Sep-04 6:40 
GeneralDatabase replication - network and island Pin
Ted Christiansen28-Sep-04 11:56
Ted Christiansen28-Sep-04 11:56 
GeneralRe: Database replication - network and island Pin
ssanoj29-Sep-04 9:59
ssanoj29-Sep-04 9:59 
GeneralSetForegroundWindow fails Pin
Neville Franks28-Sep-04 11:47
Neville Franks28-Sep-04 11:47 
GeneralRe: SetForegroundWindow fails Pin
vcplusplus28-Sep-04 12:14
vcplusplus28-Sep-04 12:14 
GeneralRe: SetForegroundWindow fails Pin
vcplusplus28-Sep-04 12:30
vcplusplus28-Sep-04 12:30 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks28-Sep-04 13:07
Neville Franks28-Sep-04 13:07 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks28-Sep-04 13:42
Neville Franks28-Sep-04 13:42 
GeneralRe: SetForegroundWindow fails Pin
Scott H. Settlemier28-Sep-04 14:46
Scott H. Settlemier28-Sep-04 14:46 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks28-Sep-04 15:15
Neville Franks28-Sep-04 15:15 
GeneralRe: SetForegroundWindow fails Pin
Phil J Pearson29-Sep-04 3:49
Phil J Pearson29-Sep-04 3:49 
GeneralRe: SetForegroundWindow fails Pin
Neville Franks29-Sep-04 10:34
Neville Franks29-Sep-04 10:34 

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.