I need to get handle to all programs in taskbar for moving, resizing, etc them later.
I can get a list of all visible windows, but the problem is that program puts in the list also windows that aren't on the taskbar (for example if delphi isn't minimized, in the list can be found these: 'Unit1.pas', 'Form1', 'Delphi - Project [Running]').
I filter the list with this code:
if (title<>'') and
(IsWindowVisible(hwnd)=true) and
(IsWindowEnabled(hwnd)=true) and
(GetParent(hwnd)=0) and
(GetWindowLong(hwnd, GWL_EXSTYLE)<>WS_EX_TOOLWINDOW) and
(title<>'Program Manager') then ...
But this isn't working. Looks like delphi isn't parent for those windows (GetParent() always returns 0).
When I added this line to the IF:
... ((GetWindowLong(hWnd, GWL_HWNDPARENT) = 0)or(GetWindowLong(hWnd, GWL_HWNDPARENT) = GetDesktopWindow)) and ...
it filters out delphi forms, but adds to the list programs that are hidden in the tray.
Any ideas how to create/filter this list?
I can get a list of all visible windows, but the problem is that program puts in the list also windows that aren't on the taskbar (for example if delphi isn't minimized, in the list can be found these: 'Unit1.pas', 'Form1', 'Delphi - Project [Running]').
I filter the list with this code:
if (title<>'') and
(IsWindowVisible(hwnd)=true) and
(IsWindowEnabled(hwnd)=true) and
(GetParent(hwnd)=0) and
(GetWindowLong(hwnd, GWL_EXSTYLE)<>WS_EX_TOOLWINDOW) and
(title<>'Program Manager') then ...
But this isn't working. Looks like delphi isn't parent for those windows (GetParent() always returns 0).
When I added this line to the IF:
... ((GetWindowLong(hWnd, GWL_HWNDPARENT) = 0)or(GetWindowLong(hWnd, GWL_HWNDPARENT) = GetDesktopWindow)) and ...
it filters out delphi forms, but adds to the list programs that are hidden in the tray.
Any ideas how to create/filter this list?