DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Posts
    33

    Lock mouse input

    How can we lock mouse just for our application. I mean ... i dont want to lock mouse for the windows as "BlockInput" API does, i just want to block mouse input on my application for a specified time.

    Regards

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Set the Enabled property of the visible form(s) or controls to False.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jun 2005
    Posts
    33
    by setting Enabled=False, form is grayed out

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    OK, how about simply ignoring any mouse clicks you receive?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Jun 2005
    Posts
    33
    Yes, this is what i need, but how?? Do i need to capture the mouse events for controls, IMO this is not a good approach. What do you suggest?
    Last edited by sequel; 06-23-2006 at 02:00 AM.

  6. #6
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Code:
    ' Declare form-level 'ignore mouse' flag
    ' Set to True when you want to 'disable' the mouse
    Private bIgnoreMouse As Boolean
    
    Private Sub Button1_Click(ByVal sender As System.Object, _ 
        ByVal e As System.EventArgs) Handles Button1.Click
        ' Check flag in all mouse-related event handlers
        If Not bIgnoreMouse Then
            ' Handle mouse click
        End If
    End Sub
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 5
    Last Post: 05-16-2006, 06:20 AM
  2. Capturing Mouse Movements outside of screen resolution
    By Chris Eastwood in forum VB Classic
    Replies: 4
    Last Post: 03-28-2002, 01:26 PM
  3. Mouse Movement Playback
    By Eugene in forum VB Classic
    Replies: 4
    Last Post: 12-19-2000, 12:52 PM
  4. Mouse Movement Playback
    By Eugene in forum VB Classic
    Replies: 0
    Last Post: 12-19-2000, 11:13 AM
  5. how to easily lock out the mouse clicks
    By Cindy Zhang in forum authorevents.appleman
    Replies: 2
    Last Post: 04-10-2000, 03:28 PM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links