home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / iplpau.zip / IPLPAUSE.C next >
Text File  |  1993-11-01  |  2KB  |  62 lines

  1. /**********************************************************************/
  2. /*  PROGRAM:  IPLPAUSE.EXE - config.sys timer utility.              */
  3. /*  BY:  Knight Research - Copyright (c) 1993 All Rights Reserved.    */
  4. /**********************************************************************/
  5. /* Compiled with MSC 6.0 */
  6. #define INCL_DOSPROCESS
  7. #include <os2.h>
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <conio.h>
  12.  
  13. int    key;
  14. char    szInput[80];
  15. USHORT    usSeconds;
  16. RESULTCODES resc;
  17. UCHAR szFailName[CCHMAXPATH];
  18. UCHAR szCommandLine[] = { "cmd\0 /K \0" };
  19.  
  20. /***************************************************************************/
  21. /* Main                                    */
  22. /***************************************************************************/
  23. void main (int argc, char *argv[])
  24. {
  25.  if (argc > 1) {
  26.      strcpy(szInput,argv[1]);
  27.      strupr(szInput);
  28.      usSeconds = atoi(szInput);
  29.      }
  30.  
  31.  if (usSeconds == 0)
  32.      usSeconds = 15;
  33.  
  34.  printf("\n┌─────────────────────────────────────────────────────────────────────┐\n");
  35.    printf("│IPLPAUSE:  Knight Research - Copyright \(c\) 1993 All Rights Reserved. │\n");
  36.    printf("└─────────────────────────────────────────────────────────────────────┘\n");
  37.  printf("Press ANY KEY to PAUSE System Startup...OR Press <ESC> to Continue NOW.\n\n");
  38.  
  39.  while (usSeconds > 0) {
  40.      if (kbhit()) {
  41.      key = getch();
  42.      if (key != 27) {
  43.          printf("\n\nIPL has been Paused....type EXIT to continue system startup.\n\n", usSeconds);
  44.          DosExecPgm(szFailName, sizeof(szFailName), EXEC_SYNC,
  45.             szCommandLine, (PSZ) NULL, &resc, "C:\\OS2\\CMD.EXE");
  46.          printf("\n\nOS/2 Presentation Manager will now start.\n\n");
  47.          exit(1);
  48.          }
  49.      else {
  50.          printf("\n\nOS/2 Presentation Manager will now start.\n\n");
  51.          exit(0);  /* Boot Immediately */
  52.          }
  53.      }
  54.      DosSleep(1000L);
  55.      usSeconds--;
  56.      printf("===> COUNTDOWN TO PM STARTUP: %d \r", usSeconds);
  57.      }
  58.  
  59.  printf("\n\nOS/2 Presentation Manager will now start.\n\n");
  60.  exit(0);
  61. }
  62.