home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
shutdown.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-09
|
731b
|
38 lines
#define INCL_WINWORKPLACE
#define INCL_DOSFILEMGR
#define INCL_DOSERRORS
#include <os2.h>
#include <stdio.h>
int main(VOID)
{
HAB hab = NULLHANDLE;
HMQ hmq = NULLHANDLE;
BOOL fSuccess = 0;
hab = WinInitialize( 0 );
hmq = WinCreateMsgQueue( hab, 0 );
/* The following call is needed to prevent this program from hanging the shutdown... */
fSuccess = WinCancelShutdown( hmq, TRUE );
printf( "System Shutdown will now be attempted...\n" );
DosBeep(800, 90);
DosBeep(600, 90);
DosBeep(400, 300);
/* Shut the machine down */
fSuccess = WinShutdownSystem( hab, hmq );
return( 0 );
}