DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: How to use ClipCursor() to lock the region in form?

  1. #1
    Join Date
    Sep 2004
    Posts
    96

    How to use ClipCursor() to lock the region in form?

    Hi,I want to Lock the region of moving my mouse on the form.But it is failure.How about it? My code is :
    Code:
    Public Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
    
    Private Type Rect
        L As Long
        T As Long
        R As Long
        B As Long
    End Type
    
    Dim De As Rect
    Dim ReaFocu As Boolean 
    
    Private Sub Command1_Click()
        If ReaFocu = True Then
        De.L = 0
          De.T = 1000
          De.R = 1000
          De.B = 3000
          ClipCursor(De): ReaFocu = False
        Else
          ClipCursor ByVal 0: ReaFocu = True  'release it
        End If
    End Sub
    
    Private Sub Command2_Click()
      End
    End Sub
    
    Private Sub Form_Load()
       ReaFocu = True
    End Sub
    Thank you.
    Last edited by Hack; 03-07-2012 at 01:03 PM. Reason: Added Code Tags
    xuliangchu

Similar Threads

  1. to form always in the form of a program
    By dong in forum VB Classic
    Replies: 0
    Last Post: 08-20-2011, 12:00 AM
  2. Pseudocode Problem
    By zobi316 in forum VB Classic
    Replies: 3
    Last Post: 03-10-2008, 07:05 AM
  3. Replies: 0
    Last Post: 01-17-2007, 11:38 PM
  4. Replies: 0
    Last Post: 04-11-2002, 06:48 PM
  5. VirtualQueryEx
    By MacDeath in forum VB Classic
    Replies: 2
    Last Post: 02-14-2001, 06:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center