home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1867 < prev    next >
Encoding:
Text File  |  1992-09-15  |  2.2 KB  |  45 lines

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