Vizible’s Blog

C# – How to hide Taskbar?

Posted in Programming, Tips by wearetherock on July 8, 2009

// Use user32.dll
[DllImport(“user32.dll”)]
private static extern int ShowWindow(int hwnd, int command);

private const int SW_HIDE = 0;
private const int SW_SHOW = 1;

// Call ShowWindow
int hwnd = FindWindow(“Shell_TrayWnd”, “”);
ShowWindow(hwnd, SW_HIDE);

Advertisements

3 Responses

Subscribe to comments with RSS.

  1. vizible said, on July 17, 2009 at 9:27 am

    More option here.
    Hide = 0,
    ShowNormal = 1,
    ShowMinimized = 2,
    ShowMaximized = 3,
    Maximize = 3,
    ShowNormalNoActivate = 4,
    Show = 5,
    Minimize = 6,
    ShowMinNoActivate = 7,
    ShowNoActivate = 8,
    Restore = 9,
    ShowDefault = 10,
    ForceMinimized = 11

  2. vizible said, on July 17, 2009 at 10:12 am

    Also usable.

    [DllImport(“user32.dll”)]
    private static extern int ShowWindow(IntPtr hwnd, int command);

    [DllImport(“user32.dll”)]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

  3. vizible said, on July 17, 2009 at 10:16 am

    Hide taskbar & Start menu

    IntPtr startMenu = FindWindow(“Button”, “Start”);
    IntPtr taskBar = FindWindow(“Shell_TrayWnd”, “”);

    ShowWindow(startMenu, control);
    ShowWindow(taskBar, control);


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: