先拆掉一个 CPU 试试!?
解决方案 »
- vb中如何自定义一个事件,然后在代码中根据条件激活这个事件?
- calendar1日历控件问题
- 高手请进
- Formula one打包问题
- 请问用MCI做媒体播放器,要播放mpeg格式的文件时DeviceType应该设为什么?
- 请问朋友们用什么软件做安装程序包
- VB中把一个字符转换成ASC码得函数是Asc(),那么把ASC码转换成字符得函数是什么?
- 连接字符串中的Integrated Security=SSPI 是什么意思啊?有用吗??
- cuiyxy(沧海鲨鱼) 请到http://expert.csdn.net/expert/topic/547/547636.xml,接分
- 请问怎样检测打印机的状态啊!
- 求购二手书 --王国荣主编 《Visual Basic 6.0数据库程序设计》 人民邮电版 旗标系列
- 一个关于数据转换的问题,我调用一个dll它返回的是unsigned long 可VB只有long型……
sendkeys是与进程有关的。"keybd_event" 却无关,只与谁有焦点有关。Const VK_H = 72
Const VK_E = 69
Const VK_L = 76
Const VK_O = 79
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Form_KeyPress(KeyAscii As Integer)
'Print the key on the form
Me.Print Chr$(KeyAscii);
End Sub
Private Sub Form_Paint()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'Clear the form
Me.Cls
keybd_event VK_H, 0, 0, 0 ' press H
keybd_event VK_H, 0, KEYEVENTF_KEYUP, 0 ' release H
keybd_event VK_E, 0, 0, 0 ' press E
keybd_event VK_E, 0, KEYEVENTF_KEYUP, 0 ' release E
keybd_event VK_L, 0, 0, 0 ' press L
keybd_event VK_L, 0, KEYEVENTF_KEYUP, 0 ' release L
keybd_event VK_L, 0, 0, 0 ' press L
keybd_event VK_L, 0, KEYEVENTF_KEYUP, 0 ' release L
keybd_event VK_O, 0, 0, 0 ' press O
keybd_event VK_O, 0, KEYEVENTF_KEYUP, 0 ' release O
End Sub