home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: can I do mouse function 11 (delta x,y) from Windows 3.1?
- Message-ID: <1992Sep16.043021.4401@emr1.emr.ca>
- Organization: Energy, Mines, and Resources, Ottawa
- References: <1992Sep16.042818.4073@emr1.emr.ca>
- Date: Wed, 16 Sep 1992 04:30:21 GMT
- Lines: 34
-
- I want to move a rectangle around on a 'virtual' screen (NO size limit)
- with both arrow keys & mouse. I use the following:
- ShowCursor(FALSE);
- ClipCursor(NULL);
- SetCapture(hwnd);
- hdc=CreateDC("display",NULL,NULL,NULL);
- & I draw the rectangle myself in XOR mode. The cursor keys generate
- (dx,dy) values of +1 or -1, depending on key. The rectangle is drawn
- at (x+=dx,y+=dy) whether visible or not: let GDI clip it! The keyboard
- works fine, but the mouse doesn't: WM_MOUSEMOVE will only return (x,y)
- values of (0-639,0-479) therefore confining the rectangle to the screen
- boundaries. Also the rectangle position is dependent on which part
- (centre, corner) is 'tied' to the mouse (x,y).
-
- I did all of this quite easily in my DOS apps, using mousefunc 11 which
- returns DELTA (x,y) instead of using mousefunc 3 which returns POSITION
- (x,y). In that sense, it worked exactly like the keyboard, providing
- me with amount & direction of motion, which is all I really need.
-
- Does Windows use mousefunc 3 (i.e. to report WM_MOUSEMOVE)? Is there
- a formal way to access mousefunc 11 via Windows? Can I use
- int86(0x33,...) to do it myself (it doesn't seem to work: returns 0
- every time) & if so, should I use 'int86x' (I don't understand
- SEGREGS)? If I do use 'int86', am I talking to the MOUSE.SYS in my
- CONFIG.SYS or the one that Windows starts up? Are they the same?
-
- Why would I want the rectangle to move on a 'virtual' screen (if you
- can't see it, how can you select it)? I want it to work like the
- zoom/pan rectangle on a Tektronix 41XX graphics terminal (does that
- mean anything to anyone?). The idea is to allow zoom/pan on a picture
- without actually having to SEE the area being selected. This means
- you don't have start over with the unzoomed overview, just so you
- can zoom in again on a section immediately adjacent to the current zoom
- view. Trust me, it's intuitive.
-