Click here to Skip to main content
15,885,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFileDialog & OLE DB template problem Pin
kjarzabek6-Jan-04 9:11
kjarzabek6-Jan-04 9:11 
GeneralRe: CFileDialog & OLE DB template problem Pin
kjarzabek6-Jan-04 10:27
kjarzabek6-Jan-04 10:27 
QuestionHow to hide DOS prompt?? Pin
Danny Chan6-Jan-04 2:42
Danny Chan6-Jan-04 2:42 
AnswerRe: How to hide DOS prompt?? Pin
David Crow6-Jan-04 2:44
David Crow6-Jan-04 2:44 
AnswerRe: How to hide DOS prompt?? Pin
Selvam R6-Jan-04 2:58
professionalSelvam R6-Jan-04 2:58 
GeneralRe: How to hide DOS prompt?? Pin
Hauptman(n)6-Jan-04 4:04
Hauptman(n)6-Jan-04 4:04 
AnswerRe: How to hide DOS prompt?? Pin
valikac6-Jan-04 6:33
valikac6-Jan-04 6:33 
AnswerRe: How to hide DOS prompt?? Pin
shultas6-Jan-04 15:30
shultas6-Jan-04 15:30 
There's a great article on this site that explains how to do this with ShellExecuteEx(). He also talks about CreateProcess as well. I've found in my particular app ShellExecuteEx() did exactly what I wanted. (I just used this in a program yesterday which is how I know the article works great!)

click here for the article

Here's the excerpt for what you are looking for:

Q: How do I start a program, and halt execution of my current program, till that program exits?
A: You start the program using ShellExecuteEx and use WaitForSingleObject on the process handle.

SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\MyProgram.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);

...The only thing that you will have to do is where it says ShExecInfo.nShow = SW_SHOW; ... change the SW_SHOW to SW_HIDE and it'll work perfectly.
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan6-Jan-04 16:49
Danny Chan6-Jan-04 16:49 
GeneralRe: How to hide DOS prompt?? Pin
shultas6-Jan-04 17:52
shultas6-Jan-04 17:52 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan7-Jan-04 2:45
Danny Chan7-Jan-04 2:45 
GeneralRe: How to hide DOS prompt?? Pin
shultas7-Jan-04 6:09
shultas7-Jan-04 6:09 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan7-Jan-04 15:22
Danny Chan7-Jan-04 15:22 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan7-Jan-04 16:42
Danny Chan7-Jan-04 16:42 
GeneralRe: How to hide DOS prompt?? Pin
shultas7-Jan-04 21:30
shultas7-Jan-04 21:30 
GeneralRe: How to hide DOS prompt?? Pin
Danny Chan12-Jan-04 2:37
Danny Chan12-Jan-04 2:37 
GeneralRe: How to hide DOS prompt?? Pin
shultas12-Jan-04 15:21
shultas12-Jan-04 15:21 
QuestionExact memory allocated by my system ?? Pin
Anonymous6-Jan-04 2:16
Anonymous6-Jan-04 2:16 
AnswerRe: Exact memory allocated by my system ?? Pin
David Crow6-Jan-04 2:43
David Crow6-Jan-04 2:43 
AnswerRe: Exact memory allocated by my system ?? Pin
John M. Drescher6-Jan-04 4:27
John M. Drescher6-Jan-04 4:27 
GeneralRe: Exact memory allocated by my system ?? Pin
forjer6-Jan-04 5:12
forjer6-Jan-04 5:12 
GeneralRe: Exact memory allocated by my system ?? Pin
John M. Drescher6-Jan-04 5:25
John M. Drescher6-Jan-04 5:25 
GeneralRe: Exact memory allocated by my system ?? Pin
Rickard Andersson206-Jan-04 21:00
Rickard Andersson206-Jan-04 21:00 
GeneralAccess Another Thread's String Stream Pin
Anonymous6-Jan-04 2:11
Anonymous6-Jan-04 2:11 
GeneralRe: Access Another Thread's String Stream Pin
David Crow6-Jan-04 2:41
David Crow6-Jan-04 2:41 

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.