home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / CENVIW9.ZIP / DOSTIME.CMM < prev    next >
Text File  |  1994-03-08  |  997b  |  30 lines

  1. /***************************************************
  2.  *** DosTime - CEnvi example program for showing ***
  3.  *** ver.1     the Dos system time               ***
  4.  ***************************************************/
  5.  
  6. #include "WinTools.lib"
  7.  
  8. // give minimum screen size because time takes up little room
  9. ScreenSize(12,1);
  10.  
  11. // force screen to show, just so we can then resize and move it
  12. putchar(' ');
  13.  
  14. // move this small window to the very bottom-right corner of the screen
  15. GetSize(ScreenHandle(),WinWidth,WinHeight);
  16. GetScreenSize(TotalWidth,TotalHeight);
  17.  
  18. SetPosition(ScreenHandle(),
  19.             TotalWidth - (WinWidth * 8 / 12),   // against right edge of screen so only numbers show
  20.             TotalHeight - WinHeight);           // against bottom of screen
  21.  
  22. // print the time once per second and hang out here until a key is pressed
  23. while( !kbhit() ) {
  24.    reg.ah = 0x2C
  25.    interrupt(0x21,reg)
  26.    printf("\r%2d:%02d:%02d",reg.ch,reg.cl,reg.dh)
  27.    Suspend(1000);
  28. }
  29.  
  30.