home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / thnk11.zip / THNKTEST.C < prev    next >
C/C++ Source or Header  |  1995-03-23  |  2KB  |  62 lines

  1. /* This file is designed to test the thnk3.dll */
  2. /* It paints the screen green and then does some IO */
  3. #define         INCL_BASE
  4. #define         INCL_PM
  5. #include        <os2.h>
  6. #include        <stdio.h>
  7. #include        <stdlib.h>
  8. #include        <string.h>
  9. #include        "thunker.h"
  10. char    dummy[65537];
  11. static  char str[]= "This is a dummy string\0";
  12. static  char string[]= "This is a test of the VioWrtTTY function\r\n\0";
  13.  
  14.  
  15. char  getch(void);
  16. void    main()
  17. {
  18.         char    a;
  19.         long    i;
  20.         BYTE    bCell[2];
  21.         ULONG   usAttribute;
  22.         KBDINFO Kbdinfo;
  23.         char    varstring[80] ;
  24.         char    varstring1[80];
  25.         bCell[0] = 0x20;
  26.         bCell[1] = 0x22;
  27.     DosQFileMode("THNKTEST.C" ,&usAttribute, 0) ;
  28.     i = DosSetFileMode("THNKTEST.C",usAttribute, 0) ;
  29.     printf("The file set mode status was %li \n\r",i) ;
  30.         Kbdinfo.cb = sizeof (Kbdinfo) ;
  31.         VioSetCurPos(5,5,0);
  32.         VioScrollUp(0,0,0xffff,0xffff,0xffff,bCell,0);
  33.     printf("The file set mode status was %li \n\r",i) ;
  34.         KbdGetStatus(&Kbdinfo,0);
  35.         if (Kbdinfo.fsMask & KEYBOARD_ECHO_ON)
  36.                 VioWrtTTY("Echo is on\n\r", 12, 0) ;
  37.         else
  38.                 VioWrtTTY("Echo is off\n\r", 13, 0) ;
  39.         a = getch() ;
  40.         for (i = 0 ;i < 5; i++)
  41.                 printf("%c\n",a) ;
  42.         i = strlen(string);
  43.         VioWrtTTY(string, i, 0) ;
  44.         printf("%i\n",strlen(string));
  45.         sprintf(varstring,"The length of string one is %i\r\n",strlen(string));
  46.         VioWrtTTY(varstring,strlen(varstring),0);
  47.         a = 'Y' ;
  48.         a = toupper(a) ;
  49.         sprintf(varstring1,"The uppercase response to Y is: %c\n\r",a) ;
  50.         VioWrtTTY(varstring1,strlen(varstring1),0) ;
  51.         a = 'y' ;
  52.         a = toupper(a) ;
  53.         sprintf(varstring,"The uppercase response to y is: %c\n\r",a) ;
  54.         VioWrtTTY(varstring,strlen(varstring),0) ;
  55. }
  56.  
  57. char  getch(void)
  58. {
  59.         KBDKEYINFO Kbci ;
  60.         KbdCharIn( &Kbci,IO_WAIT,0);
  61.         return Kbci.chChar;
  62. }