|
|
|
How to remove an application from the taskbarLets see how to create a dialog which does not have an entry in the taskbar. If you needed to do something like this, the first place where you would most probably go is the properties of the dialog. If you do that, you will find a property "Application Window". The discription of this property in Visual Studio tells that if this property is set, the window will have an entry in the taskbar. So you would remove this property and see whether it will remove the taskbar entry of the dialog. But unfortunately, that will not remove the taskbar entry of your window. There is some more work to do. You will have to create an invisible window and set that window as the parent of the window which you are going to remove from the taskbar. In the sample application of this article, I have built a simple dialog based MFC application which do not have an entry in the taskbar. The dialog object of dialog based applications created by the Visual Studio wizard is created and shown in the IninInstance() function of the 'App' class generated by the wizard. As mentioned earlier, I have created an invisible window and set that window as the parent of our dialog window. SetRegistryKey(_T("Local AppWizard-Generated Applications")); Only 5 lines of my code! Wait! we are not finished yet. We have to remove "Application Window" property too. You can do that manually from the properties of the dialog or you can add the following line to the OnInitDialog() function of your dialog. ModifyStyleEx(WS_EX_APPWINDOW, NULL); You can download example project here. |