【C#】隱藏和顯示任務欄

Win32 API

[DllImport("user32.dll")]
private static extern int FindWindow(string ClassName, string WindowName);

[DllImport("user32.dll")]
private static extern int ShowWindow(int handle, int cmdShow);

private const int SW_HIDE = 0;//隱藏
private const int SW_SHOW = 5;//顯示

使用

ShowWindow(FindWindow("Shell_TrayWnd", null), SW_HIDE); //隱藏任務欄

ShowWindow(FindWindow("Shell_TrayWnd", null), SW_SHOW); //顯示任務欄

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章