IsVisible Taskbar

  • Thread starter Thread starter Evan Camilleri
  • Start date Start date
Hi,

Maybe this class can help you. Adding one method to obtain the
visibility of the taskbar cannot be very difficult by searching MSDN
documentation in a moment:

public sealed class TaskBar
{
private const int SW_HIDE = 0x0000;
private const int SW_SHOW = 0x0001;

private const string TASKBAR_PARAMETER = "HHTaskBar";

/// <summary>
/// Hides the taskbar so that the user cannot tap into "Start"
and exit the application
/// </summary>
public static void Hide()
{
int h = FindWindow(TASKBAR_PARAMETER, "");
ShowWindow(h, SW_HIDE);
}

/// <summary>
/// Shows the taskbar so that the user can tap into "Start"
/// </summary>
public static void Show()
{
int h = FindWindow(TASKBAR_PARAMETER, "");
ShowWindow(h, SW_SHOW);
}

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

[DllImport("coredll.dll")]
private static extern int ShowWindow(int hwnd, int nTaskShow);
}

Regards.
 
Back
Top