Excel VBA高级编程:如何隐藏”开始”菜单?

2015-04-13 17:27 阅读 117 次 评论关闭

如何隐藏"开始"菜单

我新开一个主题示说明如何隐藏"开始"菜单,这还是要调用API函数才行。

Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Const SW_SHOW = 5               '显示窗口
Public Const SW_HIDE = 0               '隐藏窗口
'-----------------------------------------------------------------------------

Sub ShowStar()
Dim TaskBarhwnd As Long, Buttonhwnd As Long
TaskBarhwnd = FindWindow("Shell_TrayWnd", vbNullString)
Buttonhwnd = FindWindowEx(TaskBarhwnd, 0, "Button", vbNullString)
ShowWindow Buttonhwnd, SW_SHOW
End Sub
'-------------------------------------------------------------------------------

Sub HideStar()
Dim TaskBarhwnd As Long, Buttonhwnd As Long
TaskBarhwnd = FindWindow("Shell_TrayWnd", vbNullString)
Buttonhwnd = FindWindowEx(TaskBarhwnd, 0, "Button", vbNullString)
ShowWindow Buttonhwnd, SW_HIDE
End Sub

版权声明:本文著作权归原作者所有,欢迎分享本文,谢谢支持!
转载请注明:Excel VBA高级编程:如何隐藏”开始”菜单? | 猎微网

评论已关闭!