本功能只在5.0,6.5.7.0 Notes客户端版本中测试通过,因为客户端是基于C++的,而8.0,8.5的客户端是基于Eclipse的,所以未测试该功能是否可行。
分两个热点:
在整个form中要定一个全局变量
Dim hmenu As Long
热点1:(隐藏菜单栏)
Declare Function GetActiveWindow Lib "user32.dll" () As Long
Declare Function GetMenu Lib "user32.dll" ( Byval hmenu As Long) As Integer
Declare Function SetMenu Lib "user32.dll" ( Byval hmenu As Long, Byval newmenu As Long ) As Integer
Sub Click(Source As Button)
Dim hwnd As Long
hwnd = GetActiveWindow()
hmenu=GetMenu(hwnd)
Call SetMenu(hwnd,0)
End Sub
热点2:(显示菜单栏)
Declare Function GetActiveWindow Lib "user32.dll" () As Long
Declare Function GetMenu Lib "user32.dll" ( Byval hmenu As Long) As Integer
Declare Function SetMenu Lib "user32.dll" ( Byval hmenu As Long, Byval newmenu As Long ) As Integer
Sub Click(Source As Button)
Dim hwnd As Long
hwnd = GetActiveWindow()
If hmenu Then
Call SetMenu(hwnd,hmenu)
Else
Msgbox "现在菜单正在显示"
End If
End Sub