home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11732 < prev    next >
Encoding:
Text File  |  1992-07-29  |  2.3 KB  |  93 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!wupost!gumby!destroyer!ubc-cs!newsserver.sfu.ca!vary
  3. From: vary@fraser.sfu.ca (Jason Vary)
  4. Subject: HELP: Mouse cursor redefinition
  5. Message-ID: <1992Jul29.233456.2758@sfu.ca>
  6. Followup-To: Poster (vary@sfu.ca)
  7. Sender: news@sfu.ca
  8. Organization: Simon Fraser University, Burnaby, B.C., Canada
  9. Date: Wed, 29 Jul 1992 23:34:56 GMT
  10. Lines: 81
  11.  
  12. Hello all,
  13.      I have a question for those who have worked in C language
  14. programming mouse applications for MS-DOS machines.
  15.      I'm using Microsoft C 6.0 and Programmer's WorkBench 1.10.
  16.      I would like to change the graphical mouse cursor (pointer)
  17. to the shape of a hand, but it just doesn't seem to work.  The
  18. following code (set_mouse_cursor_hand()) was taken almost
  19. exclusively from "Microsoft Mouse Programmer's Reference" 2nd
  20. edition, p. 143.
  21.      In the procedure I use the global structures iReg, oReg, and
  22. sReg which have been declared using <dos.h> as follows:
  23.           union REGS iReg, oReg;
  24.           struct SREGS sReg;
  25.      Immediately before calling this procedure I reset the mouse
  26. driver, and immediately after calling this procedure I display
  27. the mouse cursor.
  28.      The procedure compiles without error or warning (Warning
  29. level 4).  When it executes, the mouse cursor is a 16*16 pixel
  30. arrangement of garbage, not even resembling a hand.
  31.      I have messed around with a number of things, but nothing
  32. changes.
  33.  
  34.      Here's the code:
  35. ------------------------------------------------------------
  36. void set_mouse_cursor_hand(void)
  37. {
  38.   static int maskshand[] =
  39.   {
  40.  
  41.   /* screen mask */
  42.   0xE1FF,
  43.   0xE1FF,
  44.   0xE1FF,
  45.   0xE1FF,
  46.   0xE1FF,
  47.   0xE000,
  48.   0xE000,
  49.   0xE000,
  50.   0x0000,
  51.   0x0000,
  52.   0x0000,
  53.   0x0000,
  54.   0x0000,
  55.   0x0000,
  56.   0x0000,
  57.   0x0000,
  58.  
  59.   /* cursor mask */
  60.   0x1E00,
  61.   0x1200,
  62.   0x1200,
  63.   0x1200,
  64.   0x1200,
  65.   0x13FF,
  66.   0x1249,
  67.   0x1249,
  68.   0xF249,
  69.   0x9001,
  70.   0x9001,
  71.   0x9001,
  72.   0x8001,
  73.   0x8001,
  74.   0x8001,
  75.   0xFFFF
  76.   };
  77.  
  78.   iReg.x.ax = 9;        /* Set Graphics Cursor Block */
  79.   iReg.x.bx = 5;        /* Set horizontal hot spot */
  80.   iReg.x.cx = 0;        /* Set vertical hot spot */
  81.   sReg.es = FP_SEG(maskshand);
  82.   iReg.x.dx = FP_SEG(maskshand);
  83.   int86x(0x33, &iReg, &oReg, &sReg);
  84. }
  85. ------------------------------------------------------------
  86.  
  87. Any help would be greatly appreciated!!
  88. seeya
  89. jason
  90. --
  91. vary@sfu.ca
  92.  
  93.