Is there a way to build a C# wrapper for an existing application that will allow me to remove it from the taskbar?
More info:
I have an timer app that I supp
You would need to locate the window that is being represented in the taskbar, and remove the "show in taskbar" bit from its (extended) style. This will involve dropping down to the Windows API level. The functions you will need are:
GWL_EXSTYLE
)GWL_EXSTYLE
)The extended style bit you need to remove is WS_EX_APPWINDOW.
Please see the SetWindowLongPtr docs for info about restrictions on the use of SetWindowLongPtr
to affect windows in other threads, and potentially needing to call SetWindowPos
to cause a visual update. Windows may even prevent you from doing this altogether (e.g. for security or usability reasons)
I haven't tested this and it may depend on the target application. Finally, if this does work it will remove the window from the taskbar altogether, which may be confusing when you re-show the window, so your app may want to re-enable the WS_EX_APPWINDOW
style before showing the other app's window.