Click here to Skip to main content
16,007,504 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: check if external app is already running Pin
ThatsAlok27-Dec-05 23:36
ThatsAlok27-Dec-05 23:36 
GeneralRe: check if external app is already running Pin
ThatsAlok27-Dec-05 23:38
ThatsAlok27-Dec-05 23:38 
QuestionVisual Studio 2005: Problems with Dynamic Library using CString Pin
Mr. Accident23-Dec-05 8:41
Mr. Accident23-Dec-05 8:41 
AnswerWhy yes, I DO feel stupid today. Pin
Mr. Accident23-Dec-05 14:40
Mr. Accident23-Dec-05 14:40 
GeneralRe: Why yes, I DO feel stupid today. Pin
Gary R. Wheeler24-Dec-05 2:44
Gary R. Wheeler24-Dec-05 2:44 
GeneralRe: Why yes, I DO feel stupid today. Pin
Owner drawn26-Dec-05 17:30
Owner drawn26-Dec-05 17:30 
QuestionHow to use Win API: CreateProcess ? Pin
df669923-Dec-05 5:52
df669923-Dec-05 5:52 
AnswerRe: How to use Win API: CreateProcess ? Pin
Office Lineman23-Dec-05 7:18
Office Lineman23-Dec-05 7:18 
1. Wrap your paths in quotes (not that you need it specifically for this example, but it's good practice for space-containing paths) and escape your slashes (or use the / method):
STARTUPINFO         oStartupInfo;
PROCESS_INFORMATION oProcessInfo;
LPSTR               szCmdLine = "\"C:\\aaa\\myzip.exe\" \"C:\\abc\\a.zip\"";

memset(&oStartupInfo, 0, sizeof(STARTUPINFO));
memset(&oProcessInfo, 0, sizeof(PROCESS_INFORMATION));

oStartupInfo.cb = sizeof(STARTUPINFO);

if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE,
    0, NULL, NULL, &oStartupInfo, &oProcessInfo))
{
    // wait for program to exit
    WaitForSingleObject(oProcessInfo.hProcess, INFINITE);

    // clean up
    CloseHandle(oProcessInfo.hProcess);
    CloseHandle(oProcessInfo.hThread);
}
else
{
    TRACE("Could not open the process.  Error: %u\n", GetLastError());
}


2. Don't. Use the significantly easier method:
ShellExecute(NULL, "open", "file://C:\\abc\\b.html", NULL, NULL, SW_SHOWDEFAULT);



--
I've killed again, haven't I?
AnswerRe: How to use Win API: CreateProcess ? Pin
ThatsAlok26-Dec-05 17:46
ThatsAlok26-Dec-05 17:46 
QuestionHelp Connecting a unconnected Network-Drve Pin
meinhard_risch23-Dec-05 5:36
meinhard_risch23-Dec-05 5:36 
QuestionDrop from Shell Dll - Strategy Question Pin
depotdog23-Dec-05 5:24
depotdog23-Dec-05 5:24 
QuestionRunning a console app hidden, no window Pin
Gunn31723-Dec-05 4:43
Gunn31723-Dec-05 4:43 
AnswerRe: Running a console app hidden, no window Pin
PJ Arends23-Dec-05 10:21
professionalPJ Arends23-Dec-05 10:21 
AnswerRe: Running a console app hidden, no window Pin
Michael Dunn23-Dec-05 20:28
sitebuilderMichael Dunn23-Dec-05 20:28 
GeneralRe: Running a console app hidden, no window Pin
Gunn3174-Jan-06 3:45
Gunn3174-Jan-06 3:45 
AnswerRe: Running a console app hidden, no window Pin
vipinasda24-Dec-05 7:16
vipinasda24-Dec-05 7:16 
AnswerRe: Running a console app hidden, no window Pin
Owner drawn26-Dec-05 17:27
Owner drawn26-Dec-05 17:27 
QuestionAnalyze sound volume? Pin
Matrim Cauthon23-Dec-05 3:03
Matrim Cauthon23-Dec-05 3:03 
Questionadd colors to buttons Pin
Manmohan_198323-Dec-05 2:58
Manmohan_198323-Dec-05 2:58 
AnswerRe: add colors to buttons Pin
FarPointer23-Dec-05 3:57
FarPointer23-Dec-05 3:57 
GeneralRe: add colors to buttons Pin
Manmohan_198325-Dec-05 18:21
Manmohan_198325-Dec-05 18:21 
GeneralRe: add colors to buttons Pin
FarPointer25-Dec-05 20:28
FarPointer25-Dec-05 20:28 
GeneralRe: add colors to buttons Pin
ThatsAlok25-Dec-05 21:03
ThatsAlok25-Dec-05 21:03 
Questionunsigned char Pin
Smith#23-Dec-05 0:36
Smith#23-Dec-05 0:36 
AnswerRe: unsigned char Pin
Russell'23-Dec-05 0:52
Russell'23-Dec-05 0:52 

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.