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