Author: Jonas Bilinkevicius
I am trying to get a list of the windows that will appear on the Taskbar (and
perhaps on Alt-Tab). I have tried to find the ones with no parent windows, etc. but
I cannot find the pattern.
Answer:
As far as I know it has never been explicitly documented which criteria Windows
uses here. Try the following:
1 2 function EnumWindowsProc(Wnd: HWND; LParam: LPARAM): BOOL; stdcall;
3 begin4 Result := True;
5 if (IsWindowVisible(Wnd) or IsIconic(wnd)) and6 ((GetWindowLong(Wnd, GWL_HWNDPARENT) = 0) or7 (GetWindowLong(Wnd, GWL_HWNDPARENT) = GetDesktopWindow)) and8 { skip WS_EX_TOOLWINDOW windows }9 (GetWindowLong(Wnd, GWL_EXSTYLE) and WS_EX_TOOLWINDOW = 0) then10 begin11 { place code here }12 end;
13 end;