winform显示隐藏任务栏及开始菜单
Posted xinzheng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了winform显示隐藏任务栏及开始菜单相关的知识,希望对你有一定的参考价值。
private const int SW_HIDE = 0; private const int SW_RESTORE = 9; private const string SHELL_TRAYWND = "Shell_TrayWnd"; private const string BUTTON = "Button"; [DllImport("user32.dll")] public static extern int ShowWindow(int hwnd, int nCmdShow); [DllImport("user32.dll")] public static extern int FindWindow(string lpClassName, string lpWindowName); public static void ShowTask() { ShowWindow(FindWindow(SHELL_TRAYWND, null), SW_RESTORE); ShowWindow(FindWindow(BUTTON, null), SW_RESTORE); } public static void HideTask() { ShowWindow(FindWindow(SHELL_TRAYWND, null), SW_HIDE); ShowWindow(FindWindow(BUTTON, null), SW_HIDE); }
以上是关于winform显示隐藏任务栏及开始菜单的主要内容,如果未能解决你的问题,请参考以下文章