shell_Traywnd(winform显示、隐藏任务栏及开始菜单「终于解决」)

发布时间:2025-12-10 19:55:51 浏览次数:16

winform显示、隐藏任务栏及开始菜单「终于解决」-

winform显示、隐藏任务栏及开始菜单「终于解决」privateconstintSW_HIDE=0;privateconstintSW_RESTORE=9;privateconststringSHELL_TRAYWND="Shell_TrayWnd";privateconststring

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);}

【正版授权,激活自己账号】:Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

需要做网站?需要网络推广?欢迎咨询客户经理 13272073477