你指的是不依靠任何软件,就单在WINDOWS下就可以查看吗?就我所知,没有!只有各个程序可以查看本程序所设置的快捷键!不过通过注册表可以更改快捷键,不过好象也没什么意思,用那些程序自带的就可以改!
有快捷键的程序,打开后就会注册快捷键,关掉就会注销!如果后打开的程序快捷键和之前的重了,那么后打开的会失效!你按SHIFT+ALT+A是截图就是这个原因!部分软件注册快捷键失败了会有提示(大多是因为被其他程序抢先注册)!
可以的
模块里
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long, ByVal fskey_Modifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long) As Long
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const WM_HOTKEY = &H312
Const MOD_ALT = &H1
Const MOD_CONTROL = &H2
Const MOD_SHIFT = &H4
Const GWL_WNDPROC = (-4) '窗口函数的地址
Dim key_preWinProc As Long '用来保存窗口信息
Dim key_Modifiers As Long, key_uVirtKey As Long, key_idHotKey As Long
Dim key_IsWinAddress As Boolean '是否取得窗口信息的判断
Function keyWndproc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If Msg = WM_HOTKEY Then
Select Case wParam 'wParam 值就是 key_idHotKey
Case 1 '激活 3 个热键后,3 个热键所对应的 *** 作,大家在其他的程序中,只要修改此处就可以了
Case 2
Case 3
Case 4
Case 5
End Select
End If
' 将消息传送给指定的窗口
keyWndproc = CallWindowProc(key_preWinProc, hwnd, Msg, wParam, lParam)
End Function
Function SetHotkey(ByVal KeyId As Long, ByVal KeyAss0 As String, ByVal Action As String)
Dim KeyAss1 As Long
Dim KeyAss2 As String
Dim i As Long
i = InStr(1, KeyAss0, ",")
If i = 0 Then
KeyAss1 = Val(KeyAss0)
KeyAss2 = ""
Else
KeyAss1 = Right(KeyAss0, Len(KeyAss0) - i)
KeyAss2 = Left(KeyAss0, i - 1)
End If
key_idHotKey = 0
key_Modifiers = 0
key_uVirtKey = 0
If key_IsWinAddress = False Then '判断是否需要取得窗口信息,如果重复取得,再最后恢复窗口时,将会造成程序死掉
' 记录原来的window程序地址
key_preWinProc = GetWindowLong(Form1hwnd, GWL_WNDPROC)
' 用自定义程序代替原来的window程序
SetWindowLong Form1hwnd, GWL_WNDPROC, AddressOf keyWndproc
End If
key_idHotKey = KeyId
Select Case Action
Case "Add"
If KeyAss2 = "Ctrl" Then key_Modifiers = MOD_CONTROL
If KeyAss2 = "Alt" Then key_Modifiers = MOD_ALT
If KeyAss2 = "Shift" Then key_Modifiers = MOD_SHIFT
If KeyAss2 = "Ctrl+Alt" Then key_Modifiers = MOD_CONTROL + MOD_ALT
If KeyAss2 = "Ctrl+Shift" Then key_Modifiers = MOD_CONTROL + MOD_SHIFT
If KeyAss2 = "Ctrl+Alt+Shift" Then key_Modifiers = MOD_CONTROL + MOD_ALT + MOD_SHIFT
If KeyAss2 = "Shift+Alt" Then key_Modifiers = MOD_SHIFT + MOD_ALT
key_uVirtKey = Val(KeyAss1)
RegisterHotKey Form1hwnd, key_idHotKey, key_Modifiers, key_uVirtKey '向窗口注册系统热键
key_IsWinAddress = True '不需要再取得窗口信息
Case "Del"
SetWindowLong Form1hwnd, GWL_WNDPROC, key_preWinProc '恢复窗口信息
UnregisterHotKey Form1hwnd, key_uVirtKey '取消系统热键
key_IsWinAddress = False '可以再次取得窗口信息
End Select
End Function
工程中
Private Sub Form_Load()
SetHotkey 1, "87", "Add"
SetHotkey 2, Ctrl + "87", "Add"
SetHotkey 3, Ctrl + Alt + "87", "Add"
End Sub
Private Sub Form_Unload(Cancel As Integer)
SetHotkey 1, "", "Del"
End Sub
在使用电脑时,经常会碰到快捷键被其它程序所占用的问题,如何知道快捷键被哪个程序占用了,介绍一个解决方法。
1)在网上,搜索“快捷键查看工具”这个词。
2)能找到很多,下载回来,解压并安装。
3)启动快捷键查看工具,在左侧,显示的是快捷键,在右侧,显示的是所占用的程序,如下图。
版本 2
支持库 shellEx
程序集 窗口程序集1
子程序 __启动窗口_创建完毕
注册热键 (取窗口句柄 (), 标签1取窗口句柄 (), 1, #F12键)
子程序 _标签1_反馈事件, 整数型
参数 参数一, 整数型
参数 参数二, 整数型
载入 (窗口1, , 假)
以上就是关于如何查看windows系统当前哪些程序注册了哪些快捷键全部的内容,包括:如何查看windows系统当前哪些程序注册了哪些快捷键、请教高手关于RegisterHotKey注册热键的问题、如何查看电脑已被软件注册的快捷键等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)