home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!wupost!gumby!destroyer!ubc-cs!newsserver.sfu.ca!vary
- From: vary@fraser.sfu.ca (Jason Vary)
- Subject: HELP: Mouse cursor redefinition
- Message-ID: <1992Jul29.233456.2758@sfu.ca>
- Followup-To: Poster (vary@sfu.ca)
- Sender: news@sfu.ca
- Organization: Simon Fraser University, Burnaby, B.C., Canada
- Date: Wed, 29 Jul 1992 23:34:56 GMT
- Lines: 81
-
- Hello all,
- I have a question for those who have worked in C language
- programming mouse applications for MS-DOS machines.
- I'm using Microsoft C 6.0 and Programmer's WorkBench 1.10.
- I would like to change the graphical mouse cursor (pointer)
- to the shape of a hand, but it just doesn't seem to work. The
- following code (set_mouse_cursor_hand()) was taken almost
- exclusively from "Microsoft Mouse Programmer's Reference" 2nd
- edition, p. 143.
- In the procedure I use the global structures iReg, oReg, and
- sReg which have been declared using <dos.h> as follows:
- union REGS iReg, oReg;
- struct SREGS sReg;
- Immediately before calling this procedure I reset the mouse
- driver, and immediately after calling this procedure I display
- the mouse cursor.
- The procedure compiles without error or warning (Warning
- level 4). When it executes, the mouse cursor is a 16*16 pixel
- arrangement of garbage, not even resembling a hand.
- I have messed around with a number of things, but nothing
- changes.
-
- Here's the code:
- ------------------------------------------------------------
- void set_mouse_cursor_hand(void)
- {
- static int maskshand[] =
- {
-
- /* screen mask */
- 0xE1FF,
- 0xE1FF,
- 0xE1FF,
- 0xE1FF,
- 0xE1FF,
- 0xE000,
- 0xE000,
- 0xE000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
- 0x0000,
-
- /* cursor mask */
- 0x1E00,
- 0x1200,
- 0x1200,
- 0x1200,
- 0x1200,
- 0x13FF,
- 0x1249,
- 0x1249,
- 0xF249,
- 0x9001,
- 0x9001,
- 0x9001,
- 0x8001,
- 0x8001,
- 0x8001,
- 0xFFFF
- };
-
- iReg.x.ax = 9; /* Set Graphics Cursor Block */
- iReg.x.bx = 5; /* Set horizontal hot spot */
- iReg.x.cx = 0; /* Set vertical hot spot */
- sReg.es = FP_SEG(maskshand);
- iReg.x.dx = FP_SEG(maskshand);
- int86x(0x33, &iReg, &oReg, &sReg);
- }
- ------------------------------------------------------------
-
- Any help would be greatly appreciated!!
- seeya
- jason
- --
- vary@sfu.ca
-
-