引用
using System.Runtime.InteropServices; //引用 DllImport
宣告
[DllImport("coredll.dll", EntryPoint = "FindWindow")]
private static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
public static extern int ShowWindow(int hwnd, int nCmdShow);
調用
int _taskbarHandle = FindWindow("HHTaskBar", "");
ShowWindow(_taskbarHandle, 0); //隱藏
ShowWindow(_taskbarHandle, 1); //顯示
using System.Runtime.InteropServices; //引用 DllImport
宣告
[DllImport("coredll.dll", EntryPoint = "FindWindow")]
private static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
public static extern int ShowWindow(int hwnd, int nCmdShow);
調用
int _taskbarHandle = FindWindow("HHTaskBar", "");
ShowWindow(_taskbarHandle, 0); //隱藏
ShowWindow(_taskbarHandle, 1); //顯示
全站熱搜
留言列表