home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
CENVIW1.ZIP
/
WINEXECS.CMM
< prev
next >
Wrap
Text File
|
1993-07-14
|
1KB
|
29 lines
/*************************************************************
*** WinExecs - Sample Cmm code to demonstrate uses of the ***
*** WinExec() function. ***
*************************************************************/
#include <WinExec.lib>
#include <MsgBox.lib>
MessageBox("The following samples show various ways\n"
"to use the Windows WinExec() function.\n"
"A wrapper for WinExec() is located in\n"
"the Cmm library: \"WinExec.lib\"",
"WinExecs - Welcome!");
MessageBox("Will now start up NotePad with the C:\\Autoexec.bat file","");
result = WinExec("NotePad.exe c:\\AutoExec.bat");
if ( result < 32 ) WinExecError(result);
MessageBox("Now start the File Manager minimized","");
result = WinExec("WinFile.exe",SW_SHOWMINIMIZED);
if ( result < 32 ) WinExecError(result);
WinExecError(ErrorNumber)
{
sprintf(ErrorMessage,"That call to WinExec returned error: %d",ErrorNumber);
MessageBox(ErrorMessage);
}