Click here to Skip to main content
11,798,866 members (65,473 online)
Click here to Skip to main content

How To Hide A Window in TaskBar

, 16 Apr 2004 102.3K 35
Rate this:
Please Sign up or sign in to vote.
This article explains how to hide a window's name in the taskbar while the window itself is still active.


Sometimes we may want to make an app which doesn't actually need an annoying box in the taskbar. I hope this snippet will help.


  1. Global Declaration

    Here is some short explanation about the interface used:

    • DECLARE_INTERFACE(iface) is used to declare an interface that does not derive from a base interface.
    • DECLARE_INTERFACE_(iface, baseiface) is used to declare an interface that does derive from a base interface. This is the one that is used. And the interface will be derived from IUnknown interface.

    And then, let's create an alias definition for the derived interface.

    STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID* ppvObj) PURE;
    typedef ITaskbarList *LPITaskbarList;
  2. In the Dialog Based Class declaration

    Here is up to you, whether you want to declare the pTaskbar as an attribute of a Dialog class or not. It's not a problem, actually, since the implementation (next step) will only need the window handle (HWND).

    class CMyDlg : public CDialog
    //Init our Taskbar handler
    LPITaskbarList pTaskbar;

    Don't forget to set the pTaskbar to NULL in the construction method for your dialog class.

  3. Initialization
    BOOL CMyDlg::OnInitDialog()
    //initializes the Component Object Model(COM)
    //We call below function since we only need to create one object
    //Below function will initialize the taskbar list object
  4. Implementation

    This is the function that you can use to hide the "box" in taskbar.

    void CMyDlg::DeleteTaskbar()
    //Hide it

Try the other methods for pTaskbar, and you will experience some stuff.

Forgive me if this article doesn't explain much. My purpose is just to provide another alternative. Since this "way" hasn't been posted yet.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Aris Adrianto S
Business Analyst HSBC, Citi
Indonesia Indonesia
Multi Platform System Analyst, Application Developer, Database Designer, and Project Manager in a wide variety of Business Applications and Industrial Automations.

Experienced for in-depth data analysis, data warehousing, reporting, and actively involve in supporting the business growth.

You may also be interested in...

Comments and Discussions

QuestionHrInit() interface declaration Pin
jph.torcy21-Jun-11 3:12
memberjph.torcy21-Jun-11 3:12 
GeneralMy vote of 1 Pin
Elchay2-Feb-09 11:55
memberElchay2-Feb-09 11:55 
QuestionTaskbar button comes back Pin
Pietju20-Sep-08 5:33
memberPietju20-Sep-08 5:33 
QuestionAny idea how to change the text of a taskbar item Pin
Pit M.23-Dec-05 1:57
memberPit M.23-Dec-05 1:57 
GeneralThis method might be simpler. Pin
anonymous15-Sep-05 18:18
sussanonymous15-Sep-05 18:18 
GeneralRe: This method might be simpler. Pin
aquawicket12-Jul-07 16:54
memberaquawicket12-Jul-07 16:54 
Questionhow do i hide a program/window/taskbar/icon Pin
Anonymous28-Mar-05 5:57
sussAnonymous28-Mar-05 5:57 
AnswerRe: how do i hide a program/window/taskbar/icon Pin
Dingos Pingo6-Mar-06 18:44
memberDingos Pingo6-Mar-06 18:44 
Questionsample code ? Pin
riki_risnandar23-Nov-04 22:07
memberriki_risnandar23-Nov-04 22:07 
GeneralWhere place "pTaskbar->DeleteTab(...)" Pin
pagaia15-Sep-04 5:01
memberpagaia15-Sep-04 5:01 
GeneralSuggestion. Pin
WREY17-Apr-04 9:30
memberWREY17-Apr-04 9:30 
GeneralRe: Suggestion. Pin
Aris A S17-Apr-04 10:38
memberAris A S17-Apr-04 10:38 
General"annoying box in the taskbar" Pin
dog_spawn17-Apr-04 11:09
memberdog_spawn17-Apr-04 11:09 
GeneralRe: "annoying box in the taskbar" Pin
Aris A S17-Apr-04 11:42
memberAris A S17-Apr-04 11:42 
GeneralRe: "annoying box in the taskbar" Pin
Balder1978-218-Nov-04 6:02
memberBalder1978-218-Nov-04 6:02 

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
Web01 | 2.8.151002.1 | Last Updated 17 Apr 2004
Article Copyright 2004 by Aris Adrianto S
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid