Hide window display in Windows taskbar

Source: Internet
Author: User

In practical applications, you will encounter the following needs:

Hides Windows window, Windows taskbar window is not visible, but the application runs in the background.

Windows application's window defaults to adding a visible window item to the taskbar for easy user action and for switching between applications.

Considering that the Windows operating system is shell-based, finding the interface data for the shell will find Itaskbarlist interface. Itaskbarlist provides the AddTab and deletetab functions for adding a Delete window item to the taskbar.

The first approach is to use the Itaskbarlist interface to remove window items from the taskbar when the program starts.

The code is as follows:

1  1itaskbarlist*ptaskbarlist;2  2hr =CoCreateInstance (Clsid_taskbarlist, NULL, Clsctx_inproc_server,3  3Iid_itaskbarlist, (void* *) &ptaskbarlist);4  4 5  5 if(SUCCEEDED (HR))6  6 {7  7Ptaskbarlist->hrinit ();8  8     if(bShow)9  9Ptaskbarlist->AddTab (hWnd);Ten Ten     Else One  OnePtaskbarlist->Deletetab (hWnd); A  A  -  -Ptaskbarlist->Release (); -  -}

From another perspective,does the Windows window have a similar property that specifies the window style that is not displayed in the taskbar?

Here's a look at extended Window styles, which has such an extended property:Ws_ex_toolwindow. Specifying this property indicates that the window will be used as a floating toolbar, its window will no longer be displayed in the taskbar, and has special display processing logic, which is exactly what you need.

Then it is necessary to call the CreateWindowEx function in this way.

Also, if you want the window to be completely invisible, you can specify that the Window property is not visible when creating the window, which is to create a background process directly to handle other transactions. But it is not recommended to do so, after all, the window is completely invisible, you can directly Cui programming, no need to use the GUI.

This article Tocy

All rights reserved, do not use for commercial use, please specify the original address reproduced. I reserve all rights.

Hide window display in Windows taskbar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.