home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / shutdown.c < prev    next >
C/C++ Source or Header  |  1999-06-09  |  731b  |  38 lines

  1.  
  2. #define  INCL_WINWORKPLACE
  3. #define  INCL_DOSFILEMGR
  4. #define  INCL_DOSERRORS
  5.  
  6. #include  <os2.h>
  7. #include  <stdio.h>
  8.  
  9.  
  10. int     main(VOID)
  11. {
  12.     HAB   hab = NULLHANDLE;
  13.     HMQ   hmq = NULLHANDLE;
  14.     BOOL  fSuccess = 0;
  15.  
  16.  
  17.         hab = WinInitialize( 0 );
  18.         hmq = WinCreateMsgQueue( hab, 0 );
  19.  
  20.   /* The following call is needed to prevent this program from hanging the shutdown... */
  21.  
  22.         fSuccess = WinCancelShutdown( hmq, TRUE );
  23.  
  24.         printf( "System Shutdown will now be attempted...\n" );
  25.  
  26.         DosBeep(800, 90);
  27.         DosBeep(600, 90);
  28.         DosBeep(400, 300);
  29.  
  30.   /* Shut the machine down */
  31.  
  32.         fSuccess = WinShutdownSystem( hab, hmq );
  33.  
  34.         return( 0 );
  35.  
  36. }
  37.  
  38.