home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Mother of All Windows Books
/
CD-MOM.iso
/
cd_mom
/
newsletr
/
winprogj
/
wpjv1n5
/
winstub.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-29
|
655b
|
29 lines
// Enhanced WINSTUB.EXE for Windows applications
#include <process.h>
#include <stddef.h>
#include <iostream.h>
char answer;
int returncode;
int main(void)
{
cerr << "\nThis program requires Microsoft Windows to run.";
cerr << "\nWould you like me to start Microsoft Windows for you? ";
cin >> answer;
if (answer == 'y' || answer == 'Y')
{
returncode = spawnlp(P_WAIT,"win.com","","address",NULL);
if (returncode<0)
{
cerr << "\n\nError, could not start Microsoft Windows.";
cerr << "\nExiting back to DOS...";
}
}
else
cerr << "\n\nExiting back to DOS...";
return returncode;
}