home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 376_01 / os2tool.000 / BLANK.C < prev    next >
C/C++ Source or Header  |  1991-07-11  |  1KB  |  64 lines

  1. /*
  2. * BLANKER.C - Screen saver program.
  3. *
  4. *
  5. * PROGRAMMER:        Martti Ylikoski
  6. * CREATED:        11.7.1991
  7. */
  8. static char *VERSION = "Version  1.0" ;
  9. /*
  10. */
  11.  
  12. static char *progname ;
  13.  
  14. #include <stdio.h>
  15. #include <string.h>
  16. #include <memory.h>
  17. #define INCL_DOS
  18. #define INCL_KBD
  19. #define INCL_VIO
  20. #define INCL_DOSPROCESS
  21. #include <os2.h>
  22.  
  23. typedef struct kbdpacket
  24. {
  25.    unsigned monflags ;
  26.    KBDKEYINFO kbdkeyinfo ;
  27.    unsigned ddflags ;
  28. } KBDBUF ;
  29.  
  30. KBDBUF kbdbuf ;
  31.  
  32.  
  33. int main(int argc, char *argv[])
  34. {
  35. USHORT ret ;
  36. USHORT fWait ;
  37. VIOMODEINFO viomodeinfo ;
  38. KBDKEYINFO  kbdkeyinfo ;
  39. int col, row, outf ;
  40.  
  41.    fWait = VP_WAIT | VP_OPAQUE ;
  42.  
  43.    VioPopUp( &fWait, 0 ) ;
  44.    viomodeinfo.cb = sizeof(viomodeinfo) ;
  45.    VioGetMode(&viomodeinfo, 0) ;
  46.    outf = FALSE ;
  47.    while ( outf == FALSE)
  48.       for (row = 0; row < viomodeinfo.row && outf == FALSE ; row ++)
  49.      for (col = 0 ; col < viomodeinfo.col && outf == FALSE; col ++)
  50.      {
  51.         VioSetCurPos(row, col, 0) ;
  52.         ret = KbdCharIn(&kbdkeyinfo, IO_NOWAIT, 0) ;
  53.         if (kbdkeyinfo.fbStatus != 0)
  54.         {
  55.            outf = TRUE ;
  56.            break ;
  57.         }
  58.      DosSleep(1000L) ;
  59.      }
  60.  
  61.    VioEndPopUp(0) ;
  62.    return( 0 ) ;
  63. }
  64.