1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > c# winform 任务栏显示和隐藏

c# winform 任务栏显示和隐藏

时间:2023-10-11 10:20:21

相关推荐

c# winform 任务栏显示和隐藏

using System;using System.Collections.Generic;using System.Linq;using System.Runtime.InteropServices;using System.Text;namespace you_name{internal class taskbar{private const int SW_HIDE = 0; //隐藏任务栏private const int SW_RESTORE = 9;//显示任务栏[DllImport("user32.dll")]public static extern int ShowWindow(int hwnd, int nCmdShow);[DllImport("user32.dll")]public static extern int FindWindow(string lpClassName, string lpWindowName);/// <summary>/// 显示任务栏/// </summary>public static void showtask(){ShowWindow(FindWindow("Shell_TrayWnd", null), SW_RESTORE);}/// <summary>/// 隐藏任务栏/// </summary>public static void Hidetask(){ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE);}}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。