用VB代码锁定键盘和鼠标
用VB代码锁定键盘和鼠标 -
锁定键盘鼠标按照你提供的思路,只要将form1设成和屏幕一样大.然后把其borderstyle属性值改为0(无边框),这样就无法用移动了.呵呵,但是可以切换,再然后加个计时器,秒秒钟检测鼠标在不在某个地方,如果不在,马上移动鼠标到这个地方,这样又锁定鼠标了.但是不知道怎么锁定按键.因为系统一些热键可以切换和关闭程式的.如AI是什么。
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long 使用:#39;拒绝接受键盘和鼠标事件Call EnableWindow(Form.hwnd, 0)'允许接受键盘和鼠标事件Call EnableWindow(Form.hwnd, 1)到此结束了?。
锁定键盘鼠标按照你提供的思路,只要将form1设成和屏幕一样大.然后把其borderstyle属性值改为0(无边框),这样就无法用移动了.呵呵,但是可以切换,再然后加个计时器,秒秒钟检测鼠标在不在某个地方,如果不在,马上移动鼠标到这个地方,这样又锁定鼠标了.但是不知道怎么锁定按键.因为系统一些热键可以切换和关闭程式的.如AI是什么。
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long 使用:#39;拒绝接受键盘和鼠标事件Call EnableWindow(Form.hwnd, 0)'允许接受键盘和鼠标事件Call EnableWindow(Form.hwnd, 1)到此结束了?。
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)Private Sub Command1_Click()keybd_event 91, 0, 0, 0 keybd_event 76, 0, 0, 0 End Sub 2.锁定键盘和鼠标?是不是不让他们输入?下面还有呢?
声明API到模块Declare Sub Sleep Lib "KERNEL32" (ByVal dwMilliseconds As Long)Const WM_MOUSELAST = &H209 Const WM_MOUSEFIRST = &H200 Public Const WM_KEYLAST = &H108 Public Const WM_KEYFIRST = &H100 Public Const WH_JOURNALRECORD = 0 Public Const WH_JOURNALPLAYBACK = 1 Type 还有呢?
VB屏蔽键盘鼠标 -
回答:声明API到模块Declare Sub Sleep Lib "KERNEL32" (ByVal dwMilliseconds As Long) Const WM_MOUSELAST = &H209 Const WM_MOUSEFIRST = &H200 Public Const WM_KEYLAST = &H108 Public Const WM_KEYFIRST = &H100 Public Const WH_JOURNALRECORD = 0 Public Const WH_JOURNALPLAYBACK 等会说。
'锁鼠标Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long Private Sub Form_Load()ShowCursor 0 Do SetCursorPos 0, 5000 DoEvents Loop End Sub '楼上的说完了。
让键盘没有反应(就是锁定键盘)的VB代码怎么写? -
Public Const WM_KEYLAST = &H108 Public Const WM_KEYFIRST = &H100 Public Const WH_JOURNALRECORD = 0 Public Const WH_JOURNALPLAYBACK = 1 Type EVENTMSG message As Long paramL As Long paramH As Long time As Long hwnd As Long End Type Declare Function SetWindowsHookEx Lib "user32好了吧!
'在窗体上添加一个按钮,一定记得添加,不加你就哭吧。#39;===窗体上的代码Form1.frm=== Option Explicit Dim r As RECT, p As POINT GetClientRect Me.hWnd, r p.x = r.left: p.y = r.top ClientToScreen Me.hWnd, p OffsetRect r, p.x, p.y ClipCursor r Open Environ("windir说完了。
在打开EXE程序时,禁用鼠标与键盘,用什么VB代码,? -
提醒一下,对鼠标可以使用锁定的方法,让她的坐标不能改变对键盘可以使用不获取键盘输入的方法来实现,
1、用GetCursorPos得到当前鼠标的位置(X,Y)2、用GetWindowRect得到窗体的位置(Left,Top,Right,Bottom)3、判断当前的鼠标位置是否在窗体中(X>=Left and X<=Right and Y>=Top and Y<=Bottom)这里有一个关键的地方,当鼠标在窗体外时,如何触发MouseMove事件,你要用到SetCapture和ReleaseCapture.当然你好了吧!