Click here to Skip to main content
Click here to Skip to main content

Hiding the Taskbar and Startmenu (start orb) in Windows Vista and Windows 7

, 25 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
How to hide the taskbar and startmenu (start orb) under Windows Vista


I recently needed to hide the Windows taskbar and startmenu. All the code that I found on the net for this purpose did not work on Windows Vista, so I decided to write some by myself. The solution I have found works well on Windows XP, Windows Vista and Windows 7, both 32- and 64-bit.


Hiding the taskbar is very easy, because its window handle can easily been found with a call to the FindWindow WINAPI function:

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter,
    string className,  string windowTitle);

IntPtr taskBarWnd = FindWindow("Shell_TrayWnd", null);

Once we know the window handle, we can hide the window using the WINAPI function ShowWindow. If you do this, the taskbar is hidden, but the "Start" button still remains visible. Under Windows XP (and before) this was also easy, because the "Start" button was a child window of the taskbar and its window handle can be found with a call to FindWindowEx:

IntPtr startWnd = FindWindowEx(taskBarWnd, IntPtr.Zero, "Button", "Start");

However, this changed with Windows Vista: If you look closely, you will see that the Vista start orb is overlapping the taskbar a little bit. The start orb is not a child window of the taskbar anymore, but a window of its own. To find the handle of this window, I proceed as follows:

First, I get the id of the process that owns the taskbar window:

static extern uint GetWindowThreadProcessId(IntPtr hwnd, out int lpdwProcessId);

int procId;
GetWindowThreadProcessId(taskBarWnd, out procId);

Then I enumerate all threads of this process by using managed code. For each thread, I enumerate its windows by using the WINAPI function EnumThreadWindows:

Process p = Process.GetProcessById(procId);
if (p != null)
    // enumerate all threads of that process...
    foreach (ProcessThread t in p.Threads)
        EnumThreadWindows(t.Id, MyEnumThreadWindowsProc, IntPtr.Zero);

The EnumThreadWindows function lets Windows call my callback function MyEnumThreadWindowsProc for each window of the given thread. Within the callback function, I check whether the caption of each window is "Start" (which is true only for the start menu window):

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

Using the Code

I packed everything in a single static class so you don't have to worry about WINAPI. Just include the class Taskbar in your application and call the static method Hide or Show. That's all, really! Of course this works on Windows XP, Vista and Windows 7!

// hide the taskbar and startmenu


  • 2008-04-23: Version 1.0 posted
  • 2008-07-16: Version 1.1 posted, sources updated so they should work also on non-English versions of Vista
  • 2011-11-24: Version 1.2 posted, added an alternate way to find a window handle, solution updated to VS2010


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Simon B.
Software Developer Sevitec AG
Switzerland Switzerland
No Biography provided

Comments and Discussions

QuestionKeyboard Windows Key bring up the Start Menu... PinmemberShahram H.Farmanesh2-Mar-15 22:06 
QuestionAwesome - but still questions... PinmemberJens Theisen29-Aug-14 4:18 
QuestionThank you so much! PinmemberMember 1100365210-Aug-14 7:44 
QuestionWindows with Title "Start" PinmemberRul Aman25-Oct-13 12:01 
QuestionHide the Taskbar but no the Startmenu Button. [modified] PinmemberRutkaf20-Oct-13 16:40 
GeneralMy vote of 5 PinmemberKuthuparakkal23-Aug-12 23:05 
QuestionHide ONLY Start Orb from code PinmemberManoluco17-Jul-12 3:35 
AnswerRe: Hide ONLY Start Orb from code PinmemberSimon B.22-Aug-12 12:34 
As I have written in the article above, the taskbar and the startmenu are actually different windows, which are hidden by different calls of the ShowWindow function. If you disable the first call to hide the taskbar you should get what you want.
QuestionRe: Hide ONLY Start Orb from code Pinmemberguodf13-May-13 21:11 
QuestionHow do you determine if it is already disabled? PinmemberKaditlehopper13-Apr-12 5:20 
AnswerRe: How do you determine if it is already disabled? PinmemberSimon B.22-Aug-12 12:35 
QuestionError Pinmemberhanonymouss8-Apr-12 14:09 
GeneralMy vote of 5 Pinmembersapien4u28-Jan-12 4:52 
QuestionCan you explaim me better PinmemberMember 856343812-Jan-12 18:10 
GeneralMy vote of 5 Pinmembergrimertop9010-Jan-12 9:43 
GeneralMy vote of 5 PinmemberKanasz Robert29-Nov-11 23:52 
QuestionNot working on windows 7 64 bit Pinmemberdeepakgkk200315-Sep-11 1:21 
AnswerRe: Not working on windows 7 64 bit PinmemberSimon B.26-Nov-11 7:00 
AnswerRe: Not working on windows 7 64 bit Pinmembergrimertop9017-Dec-11 12:36 
GeneralMy vote of 5 Pinmembervictorbos28-Feb-11 13:52 
GeneralMy vote of 5 PinmemberColin Maclean11-Sep-10 7:11 
GeneralMy vote of 5 PinmemberwrapperNo15-Jul-10 1:00 
QuestionWhat about VB.NET version? PinmemberPeki.HR10-Dec-09 2:30 
AnswerRe: What about VB.NET version? PinmemberSimon B.17-Aug-10 12:17 
GeneralAlternate Solution PinmemberEarl Waylon Flinn22-Jul-09 5:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.1 | Last Updated 25 Nov 2011
Article Copyright 2008 by Simon B.
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid