home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / numlok.zip / NUMLOK.C next >
C/C++ Source or Header  |  1993-08-03  |  604b  |  31 lines

  1. #include <stddef.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4.  
  5. /*******************************
  6.  Released into the public domain
  7.  *******************************/
  8.  
  9. char credits[]="  Witten by Michael F. Oryl Jr.  ";
  10.  
  11. void main(int argc, char *argv[]){
  12.     char far *bitmap;
  13.     char response[255];
  14.  
  15.     bitmap=(char far*)MK_FP(0,0x417);
  16.  
  17.     if (argc<2){
  18.         printf("\nUsage:  NUMLOK [ON|OFF]\n\n");
  19.         exit(2);
  20.     }
  21.  
  22.     strcpy(response,argv[1]);
  23.     strupr(response);
  24.  
  25.     if (strcmp(response,"ON")){
  26.         *bitmap&=223;
  27.     }
  28.     else{
  29.         *bitmap|=32;
  30.     }
  31. }