如何屏蔽系统的F10键菜单功能?

thfunction 2000-09-20 11:52:00
我的程序要用到F10功能键,但被系统抢先响应,如何才能屏蔽系统的F10键菜单功能,急!!!!
...全文
514 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zorro2000 2000-09-23
  • 打赏
  • 举报
回复
试试将窗口的keypreciew的属性设置成true
判断按下的键是否是F10,如果不是,则...
如果是,则...
shines77 2000-09-22
  • 打赏
  • 举报
回复
老兄,你跑你哪了??
shines77 2000-09-21
  • 打赏
  • 举报
回复
具体代码如下:

Option Explicit

Private Const MOD_ALT = &H1
Private Const MOD_CONTROL = &H2
Private Const MOD_SHIFT = &H4
Private Const PM_REMOVE = &H1
Private Const WM_HOTKEY = &H312
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private bCancel As Boolean
Private Sub ProcessMessages()
Dim Message As Msg
'loop until bCancel is set to True
Do While Not bCancel
'wait for a message
WaitMessage
'check if it's a HOTKEY-message
If PeekMessage(Message, Me.hWnd, WM_HOTKEY, WM_HOTKEY, PM_REMOVE) Then
'minimize the form
WindowState = vbMinimized
End If
'let the operating system process other events
DoEvents
Loop
End Sub
Private Sub Form_Load()
'Shines 2000
'URL: http://shines.yeah.net/
'E-Mail: wokss@yeah.net
Dim ret As Long
bCancel = False
'register the F10 hotkey
ret = RegisterHotKey(Me.hWnd, &HBFFF&, 0, vbKeyF10)
'show some information
Me.AutoRedraw = True
Me.Print
Me.Print " 按 F10 热键最小化窗口。"
'show the form and
Show
'process the Hotkey messages
ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
'unregister hotkey
Call UnregisterHotKey(Me.hWnd, &HBFFF&)
End Sub

请给分。
shines77 2000-09-20
  • 打赏
  • 举报
回复
呵呵,这怎么是系统热键呢,注册一个系统热键就可以了。
thfunction 2000-09-20
  • 打赏
  • 举报
回复
lumine,在许多的软件内按F10键后菜单栏会有凸起的响应我要屏蔽这功能!
  • 打赏
  • 举报
回复
F10是系统的菜单键?什么系统?我按F10怎么没有反应。
shines77 2000-09-20
  • 打赏
  • 举报
回复
注册热键F10不知道可不可以,因为如果是系统热键可能会重复,不过我发现F10被系统定义啊,有吗??可能有

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧