home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / system / inabox / clip.bas next >
Encoding:
BASIC Source File  |  1995-02-26  |  774 b   |  31 lines

  1. 'For more info... Blaine Leckett  CIS: 73730,761
  2.  
  3. 'Rectangle type
  4. Type CLIPRECT
  5.   x1 As Integer
  6.   y1 As Integer
  7.   x2 As Integer
  8.   y2 As Integer
  9. End Type
  10.  
  11. ' Windows Clip Cursor Functions
  12. Declare Sub GetWindowRect Lib "User" (ByVal hWnd As Integer, lpRect As CLIPRECT)
  13. Declare Sub ClipCursorRect Lib "User" Alias "ClipCursor" (rect As CLIPRECT)
  14. Declare Sub ClipCursorClear Lib "User" Alias "ClipCursor" (ByVal rect&)
  15.  
  16. Sub ClipMouseMovement ()
  17.   Dim rect As CLIPRECT
  18.  
  19.   'Get the corners of our clipping area (Picture1)
  20.   GetWindowRect Form1.Picture1.hWnd, rect
  21.   
  22.   'Restrict the mouse to our window (Picture1)
  23.   ClipCursorRect rect
  24. End Sub
  25.  
  26. Sub UnClipMouseMovement ()
  27.   'Frees mouse from inside the window (Picture1)
  28.   ClipCursorClear 0
  29. End Sub
  30.  
  31.