《用excel文档让电脑开始菜单隐藏或显示.docx》由会员分享,可在线阅读,更多相关《用excel文档让电脑开始菜单隐藏或显示.docx(2页珍藏版)》请在三一办公上搜索。
1、用excel文档让电脑开始菜单隐藏或显示用excel文档让电脑开始菜单隐藏或显示 1、打开excel文档,点 工具-宏-宏安全性-设为“低”-确定-关闭excel文档。 2、再打开excel文档,对工作薄标签点右键-查看代码,对左上边出现的空白处点右键-插入-模块,然后双击新插入的模块,在右边出现的窗口中,将下面的代码复制到里面。 3、保存一下,可别忘了,否则刚才的工作可能就会白做了,点 工具-宏-宏双击“隐藏开始菜单”以运行代码。 4、看看,电脑的开始菜单是不是不见了?呵呵,不难吧? 5、想再显示出来?还像上一步一样点“显示开始菜单”,看,又出来了吧。 多练习几遍。 代码: Declare
2、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, By
3、Val hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Public Const SW_SHOW = 5 显示窗口 Public Const SW_HIDE = 0 隐藏窗口 Sub 显示开始菜单 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 隐藏开始菜单 Dim TaskBarhwnd As Long, Buttonhwnd As Long TaskBarhwnd = FindWindow(Shell_TrayWnd, vbNullString) Buttonhwnd = FindWindowEx(TaskBarhwnd, 0, Button, vbNullString) ShowWindow Buttonhwnd, SW_HIDE End Sub