您的位置:首页 > 其它

A Class To Hide Show Task Bar (Works With XP)

2012-04-01 14:49 375 查看
using System;
using System.Runtime.InteropServices;

///
/// This class will show or hide windows taskbar for full screen mode.
///
internal class HandleTaskBar
{
private const int SWP_HIDEWINDOW = 0x0080;
private const int SWP_SHOWWINDOW = 0x0040;

///
/// Default Constructor.
///
public HandleTaskBar()
{
}

[DllImport("User32.dll", EntryPoint="FindWindow")]
private static extern int FindWindow(string lpClassName, string lpWindowName);

[DllImport("User32.dll")]
private static extern int SetWindowPos(int hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);

///
/// Show the TaskBar.
///
public static void showTaskBar()
{
int hWnd = FindWindow("Shell_TrayWnd", "");
SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW);
}

///
/// Hide the TaskBar.
///
public static void hideTaskBar()
{
int hWnd = FindWindow("Shell_TrayWnd", "");
SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐