Archiv verlassen und diese Seite im Standarddesign anzeigen : [VB.NET] Tastatur & Maus De/Aktivieren
Mit diesem Code lässt sich die Tastatur und die Maus aktivieren bzw. deaktivieren.
Zur Sicherheit sollte man zum Wiederaktivieren einen Timer einbauen, da man sonst nur mit Neustart wieder schreiben und Maus bewegen könnte :D
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Const API_FALSE As Long = 0&
Const API_TRUE As Long = 1&
'Tastatur und Maus deaktivieren
Call BlockInput(API_TRUE)
'Tastatur und Maus aktivieren
Call BlockInput(API_FALSE)
z0ND :cool:
Nice thanks for share ;)
Public Class Form1
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Const API_FALSE As Long = 0&
Const API_TRUE As Long = 1&
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call BlockInput(API_TRUE)
Timer1.Start()
Timer1.Interval = 10000
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Call BlockInput(API_FALSE)
Timer1.Stop()
Me.Close()
End Sub
End Class
hier nochmal mit timer angepasst ;)
einfach ne timer einfügen.
Nice thanks for share ;)
Public Class Form1
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Const API_FALSE As Long = 0&
Const API_TRUE As Long = 1&
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call BlockInput(API_TRUE)
Timer1.Start()
Timer1.Interval = 10000
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Call BlockInput(API_FALSE)
Timer1.Stop()
Me.Close()
End Sub
End Class
hier nochmal mit timer angepasst ;)
einfach ne timer einfügen.
Ich war zu faul dafür^^
Danke fürs reinstellen^^
Sowas brauche ich sogar gerade ;-)
biggermanbomber
14.07.2009, 22:00
genau ... aber nicht vergessen dem vic nicht die exe mit dem timer zu geben xD sollte man zummindestens nicht machen
*pfeif*
Also bei mir geht das nich! hab zu 100% alles richtig gemacht!
hab win7 64bit einer ne idee?
Powered by vBulletin® Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.