Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4532652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:03:26+00:00 2026-05-21T14:03:26+00:00

I am trying to hide the Windows 7 taskbar in C#. I looked at

  • 0

I am trying to hide the Windows 7 taskbar in C#. I looked at this post and this page, but after following all the instructions, I ended up with a plain black bar at the bottom.
I ended up with a taskbar class like this:

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;

public static class Taskbar
{
    [DllImport("user32.dll")]
    private static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count);
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    private static extern bool EnumThreadWindows(int threadId, EnumThreadProc pfnEnum, IntPtr lParam);
    [DllImport("user32.dll", SetLastError = true)]
    private static extern System.IntPtr FindWindow(string lpClassName, string lpWindowName);
    [DllImport("user32.dll", SetLastError = true)]
    private static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle);
    [DllImport("user32.dll")]
    private static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
    [DllImport("user32.dll")]
    private static extern uint GetWindowThreadProcessId(IntPtr hwnd, out int lpdwProcessId);

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

    private const string VistaStartMenuCaption = "Start";
    private static IntPtr vistaStartMenuWnd = IntPtr.Zero;
    private delegate bool EnumThreadProc(IntPtr hwnd, IntPtr lParam);

    public static void Show()
    {
        SetVisibility(true);
    }

    public static void Hide()
    {
        SetVisibility(false);
    }

    public static bool Visible
    {
        set { SetVisibility(value); }
    }

    private static void SetVisibility(bool show)
    {
        IntPtr taskBarWnd = FindWindow("Shell_TrayWnd", null);

        IntPtr startWnd = FindWindowEx(taskBarWnd, IntPtr.Zero, "Button", "Start");
        if (startWnd == IntPtr.Zero)
        {
            startWnd = FindWindow("Button", null);

            if (startWnd == IntPtr.Zero)
            {
                startWnd = GetVistaStartMenuWnd(taskBarWnd);
            }
        }

        ShowWindow(taskBarWnd, show ? SW_SHOW : SW_HIDE);
        ShowWindow(startWnd, show ? SW_SHOW : SW_HIDE);
    }

    private static IntPtr GetVistaStartMenuWnd(IntPtr taskBarWnd)
    {
        int procId;
        GetWindowThreadProcessId(taskBarWnd, out procId);

        Process p = Process.GetProcessById(procId);
        if (p != null)
        {
            foreach (ProcessThread t in p.Threads)
            {
                EnumThreadWindows(t.Id, MyEnumThreadWindowsProc, IntPtr.Zero);
            }
        }
        return vistaStartMenuWnd;
    }

    private static bool MyEnumThreadWindowsProc(IntPtr hWnd, IntPtr lParam)
    {
        StringBuilder buffer = new StringBuilder(256);
        if (GetWindowText(hWnd, buffer, buffer.Capacity) > 0)
        {
            Console.WriteLine(buffer);
            if (buffer.ToString() == VistaStartMenuCaption)
            {
                vistaStartMenuWnd = hWnd;
                return false;
            }
        }
        return true;
    }
}

I’ve taken a screenshot of the problem:

Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:03:27+00:00Added an answer on May 21, 2026 at 2:03 pm

    If you have a WPF window, set its WindowStyle to None, and maximize it, it covers the whole screen (covering the TaskBar). If you use Windows Forms, something similar may also work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to hide window after its startup. I have own window-class which is
I am trying to hide some divs before the user prints this giant form,
I'm trying to hide the Title field in a list. This doesn't seem to
I'm trying to create an application that adheres to the following: No Taskbar No
I'm trying to hide the statur bar on the top of my Silverlight Windows
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
I am trying to hide the button based on the user's role using the
I'm trying to hide actual sub-directory from url path using mod_rewrite. The folder actual
I'm trying to hide some of my Perl program from the end user to
For example what if I am trying to hide a custom navigation control what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.