/************************************************************* *** WinExecs - Sample Cmm code to demonstrate uses of the *** *** WinExec() function. *** *************************************************************/ #include #include 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); }