title: Hide another app's taskbar button
body: <p>I would like to be able to hide another application's window from the taskbar, without hiding the window itself. Specifically, I want to have several different Web browsers running, visible, available in the Alt+Tab list, but not taking up space on the taskbar.</p>
  
  <p>(If anyone's curious why: I've written a dashboard app that uses Vista's DwmRegisterThumbnail APIs to show live previews of several windows at once -- a sort of "picture in picture", if you will. At that point, also having taskbar buttons for those windows seems redundant.)</p>
  
  <p>I am aware that changing the other window's style to include <code>WS_EX_TOOLWINDOW</code> will hide it from the taskbar, and I tried this first. But, as expected, it had some side effects I didn't want: the title bar got shorter (not all bad, I guess) and the minimize and maximize buttons went away (not good). I also had to hide and re-show the window to get the taskbar to recognize the change, which caused repainting artifacts when I did it to IE windows.</p>
  
  <p>My next thought was that, since windows with owners are hidden from the taskbar by default, maybe I could change the other windows to be owned by mine. But MSDN is <a href="http://msdn.microsoft.com/en-us/library/ms632599(VS.85).aspx#owned_windows" rel="nofollow noreferrer">pretty clear</a> that "[a]fter creating an owned window, an application cannot transfer ownership of the window to another window."</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/261601/hide-a-forms-taskbar-button-without-using-wsextoolwin">this question</a> that's worded similarly to mine, but it's specifically about windows from your own process, where you have complete control over window ownership.</p>
  
  <p>Does anyone know of any other ways to hide a taskbar button, that will work for windows from another process?</p>
  
  <hr>
  
  <p><strong>Update:</strong> Tormod put me on the right track with ITaskbarList -- it works great. The pinvoke.net page had some errors (wrong GUID, methods declared alphabetically instead of in interface order), but I edited it, made corrections, and also added an example of how to instantiate the ITaskbarList via its coclass.</p>
  
  <p><strong>Update 2:</strong> If you use DeleteTab to hide a window's taskbar button, and then make that the active window (e.g. via <code>SetForegroundWindow</code> or Alt+Tab), its taskbar button will reappear. To keep the taskbar button hidden, I had to add a timer and keep calling DeleteTab. As long as you don't mind the taskbar button reappearing briefly whenever the window gets focused, this works well.</p>