Results 1 to 1 of 1

Thread: Blocking Keyboard/Mouse Using API

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Blocking Keyboard/Mouse Using API

    Code:
        Declare Function apiBlockInput Lib "user32" _
        Alias "BlockInput" (ByVal fBlock As Integer) As Integer
    Code:
        Private Sub BlockInputButton1_click ()
            apiBlockInput(1) 'This will block input/mouse...
            System.Threading.Thread.Sleep(x) '...for x amount of time (in miliseconds)
            apiBlockInput(0) 'This will unluck it after x amout of time has passed
        End Sub
    Last edited by tassa; May 9th, 2009 at 01:24 PM.
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width