' Reference to the user32 api dll
Declare Sub keybd_event Lib "user32" ( _
ByVal bVk As Integer, _
ByVal bScan As Integer, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Sub Main
' Press "Win + D" key combination can toggle the state of all windows on desktop
Dim Result As Integer
Dim s As String
Const KEYEVENTF_KEYUP = &H2
Const VK_LWIN = &H5B
' 68 is the character code for the letter 'D'
Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(68, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
End Sub作者: pcl2004_27 时间: 2004-9-22 20:34
不错,
给其他人介绍一下,模拟键盘用api函数Keybd_event,模拟鼠标按键用mouse_event函数