-1

I am making a taskbar in C# and I know how to get a list of open windows, but I must know what windows I must show in the taskbar. How can I do this?

Factor Mystic
  • 26,279
  • 16
  • 79
  • 95
Aaron de Windt
  • 16,794
  • 13
  • 47
  • 62

1 Answers1

3

I'm not sure if the exact algorithm is known, but you will not be far off with something like:

if style & WS_VISIBLE 
{
  if ( ( exstyle & WS_EX_APPWINDOW ) 
  or ( !HasOwnerWindow() and !(exstyle & WS_EX_TOOLWINDOW) ) 
  {
        ShowWindowInYourTaskBar()
  }
}
Anders
  • 97,548
  • 12
  • 110
  • 164
  • I was trying something similar, that didn't give me all windows. This one gives me to much windows. The windows with the ShowInTaskBar property set to false also appear on the list. – Aaron de Windt Aug 15 '10 at 04:39
  • Did you call GetWindow(hwnd, GW_OWNER) to check if the window has an owner? – Anders Dec 18 '11 at 07:59