Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to hide DOS prompt?? Pin
shultas6-Jan-04 15:30
shultas6-Jan-04 15:30 
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 
Hi Danny.

That's an easy add-on!




SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\djpeg.exe";
ShExecInfo.lpParameters = "JPEG.jpg jpeg.ppm"; // --- THIS IS YOUR PARAMS!
// ShExecInfo.lpFile = "c:\\cjpeg.exe";
// ShExecInfo.lpParameters = "-smooth 50 jpeg.ppm average.jpg"; // --- This is the second
// program needed to execute.
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);

Lets do one at a time. So, we've got the first program to excute. Right after the WaitForSingleObject() line, put your second EXE in there. Such as this:

SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\djpeg.exe";
ShExecInfo.lpParameters = "JPEG.jpg jpeg.ppm"; // --- THIS IS YOUR PARAMS!
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
// When first .EXE is done running, we'll get here. Now, we've already got most of the data
// that we need, lets just make a modification to it real quick.
ShExecInfo.lpFile = "c:\\cjpeg.exe";
ShExecInfo.lpParameters = "-smooth 50 jpeg.ppm average.jpg"; // --- This is the second
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);


Bingo. Simple as that. Add those four extra lines in there. Your program will now call djpeg.exe first. Then, once that is done running, it'll call cjpeg.exe to do the rest of the work!!!!

That shall help you out!

Shultas
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 
GeneralRe: Access Another Thread's String Stream Pin
Mike Dimmick6-Jan-04 3:56
Mike Dimmick6-Jan-04 3:56 
GeneralRe: Access Another Thread's String Stream Pin
John M. Drescher6-Jan-04 4:07
John M. Drescher6-Jan-04 4:07 
GeneralMFC 7.0 and 98 Pin
Anonymous6-Jan-04 1:49
Anonymous6-Jan-04 1:49 
GeneralRe: MFC 7.0 and 98 Pin
Nick Hodapp6-Jan-04 4:25
sitebuilderNick Hodapp6-Jan-04 4:25 
GeneralRe: MFC 7.0 and 98 Pin
Anonymous6-Jan-04 6:20
Anonymous6-Jan-04 6:20 
GeneralMap URL address to IP address Pin
Anonymous6-Jan-04 0:16
Anonymous6-Jan-04 0:16 
GeneralRe: Map URL address to IP address Pin
Imran Farooqui6-Jan-04 1:23
Imran Farooqui6-Jan-04 1:23 

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.