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

C / C++ / MFC

 
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 
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 
Hey there. Here's the code snippet that I pasted in my previous post. I made some modifications to it that should suit your needs.

SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\jpegtran.exe";
ShExecInfo.lpParameters = "-greyscale JPEG.jpg greyscale.jpg"; // --- THIS IS YOUR PARAMS!
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);

..............
Have a peek at the line
ShExecInfo.lpParameters = "-greyscale JPEG.jpg greyscale.jpg"; // --- THIS IS YOUR PARAMS!

MSDN says...
lpParameters:
Address of a null-terminated string that contains the application parameters. The parameters must be separated by spaces. If the lpFile member specifies a document file, lpParameters should be NULL.

So, using this code with
ShExecInfo.lpFile = "c:\\jpegtran.exe";
ShExecInfo.lpParameters = "-greyscale JPEG.jpg greyscale.jpg"; // --- THIS IS YOUR PARAMS!

will run the program just like:
command = "jpegtran -greyscale JPEG.jpg greyscale.jpg";
system(command);

(except by using SW_HIDE it won't show the DOS window)

Hope that helps!!
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 
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 

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.