文件名称:sethotkey
-
所属分类:
- 标签属性:
- 上传时间:2014-05-15
-
文件大小:2.3kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
VB设置快捷键的例子,自定义打开某程序的快捷键,这只是一个示例,演示原理和具体的代码实现:
Dim bCancel As Boolean 用于判断是否退出程序
Public Sub RegFastKey() 注册快捷键
Dim ret As Long
bCancel = False
ret = RegisterHotKey(hwnd, &HBFFF&, MOD_CONTROL, vbKeyF)
ProcessMessages
End Sub
Public Sub UnRegFastKey()
bCancel = True
UnregisterHotKey hwnd, &HBFFF&
End Sub
Private Sub ProcessMessages() 监听快捷键消息
Dim Message As Msg
Do While Not bCancel
If PeekMessage(Message, hwnd, WM_HOTKEY, WM_HOTKEY, &H1) Then
MsgBox "快捷键"
End If
DoEvents
Loop
End Sub-VB to set an example of shortcuts, custom shortcuts to open a program, this is just an example that demonstrates the principles and specific code:
Dim bCancel As Boolean used to determine whether to exit the program
Public Sub RegFastKey () registration shortcuts
Dim ret As Long
bCancel = False
ret = RegisterHotKey (hwnd, & HBFFF &, MOD_CONTROL, vbKeyF)
ProcessMessages
End Sub
Public Sub UnRegFastKey ()
bCancel = True
UnregisterHotKey hwnd, & HBFFF &
End Sub
Private Sub ProcessMessages () listen shortcuts message
Dim Message As Msg
Do While Not bCancel
If PeekMessage (Message, hwnd, WM_HOTKEY, WM_HOTKEY, & H1) Then
MsgBox "shortcut"
End If
DoEvents
Loop
End Sub
Dim bCancel As Boolean 用于判断是否退出程序
Public Sub RegFastKey() 注册快捷键
Dim ret As Long
bCancel = False
ret = RegisterHotKey(hwnd, &HBFFF&, MOD_CONTROL, vbKeyF)
ProcessMessages
End Sub
Public Sub UnRegFastKey()
bCancel = True
UnregisterHotKey hwnd, &HBFFF&
End Sub
Private Sub ProcessMessages() 监听快捷键消息
Dim Message As Msg
Do While Not bCancel
If PeekMessage(Message, hwnd, WM_HOTKEY, WM_HOTKEY, &H1) Then
MsgBox "快捷键"
End If
DoEvents
Loop
End Sub-VB to set an example of shortcuts, custom shortcuts to open a program, this is just an example that demonstrates the principles and specific code:
Dim bCancel As Boolean used to determine whether to exit the program
Public Sub RegFastKey () registration shortcuts
Dim ret As Long
bCancel = False
ret = RegisterHotKey (hwnd, & HBFFF &, MOD_CONTROL, vbKeyF)
ProcessMessages
End Sub
Public Sub UnRegFastKey ()
bCancel = True
UnregisterHotKey hwnd, & HBFFF &
End Sub
Private Sub ProcessMessages () listen shortcuts message
Dim Message As Msg
Do While Not bCancel
If PeekMessage (Message, hwnd, WM_HOTKEY, WM_HOTKEY, & H1) Then
MsgBox "shortcut"
End If
DoEvents
Loop
End Sub
(系统自动生成,下载前可以参看下载内容)
下载文件列表
快捷键/Form1.frm
快捷键/Module1.bas
快捷键/MSSCCPRJ.SCC
快捷键/工程1.vbp
快捷键/工程1.vbw
快捷键
快捷键/Module1.bas
快捷键/MSSCCPRJ.SCC
快捷键/工程1.vbp
快捷键/工程1.vbw
快捷键
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.