Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find All Open Programs
With IsWindowVisible use window handle (handles[i]), not title (arr[i]). There are also other strange things in the macro.
Try this. If you need hidden windows, remove ! before IsWindowVisible, and disable next line.

Copy      Help
str s title cls exe
ARRAY(int) handles
GetWindowList 0 "" 0 0 0 handles

for(int'i 0 handles.len)
,int hwnd=handles[i]
,if(!IsWindowVisible(hwnd)) continue ;;exclude hidden
,if(GetWinStyle(hwnd 1)&WS_EX_TOOLWINDOW) continue ;;exclude such windows as QM toolbars, taskbar, most other toolbars, most tooltips, etc
,exe.getwinexe(hwnd 1)
,if(exe.endi("blackbox.exe")) exe = "explorer.exe *1"
,if(cls=="HH Parent") exe = "c:\windows\hh.exe *0"
,title.findreplace(":" " ") ;;escape :
,title.escape(1) ;;escape "
,s.formata("%s :act %i; err * %s[]" title hwnd exe)

;out s

int htb=win("MY_TASKBAR" "QM_Toolbar")
if(htb) s.setmacro("my_taskbar") ;;just replace text, which will automatically update the toolbar
else htb=DynamicToolbar(s "my_taskbar")
didnt even think of that thanks! Big Grin ..........

one more thing, using the hwnd worked great it skipped the visible windows but for some reason the above code is making the visible windows grayed out on the tool bar its still making them you just cant click on them any ideas?

thanks so much.
What text is in s?
sorry i didnt see one of your posts the code you gave worked great thanks so much

Is possible get the windows in order of taskbar with GetWindowList2?
No, or I don't know.
you can get the window order on taskbar with acc.
change "Ausgeführte Anwendungen" to the english equivalent.

Copy      Help
Acc a=acc("Ausgeführte Anwendungen" "TOOLBAR" win("" "Shell_TrayWnd") "ToolbarWindow32" "" 0x1001)
,out a.Name
,err break

how to navigate to it when using the parent as start to avoid the language problem ?
Copy      Help
Acc a=acc("" "CLIENT" win("" "Shell_TrayWnd") "MSTaskSwWClass" "" 0x1000)
In Find Accessible Object dialog, capture/select the parent object, select 'Show all', and experiment with Navigate.

In this case it will probably be:

first child4 first

This also works:

first first first

Note that invisible objects sometimes are included and sometimes not. For example, invisible MENUBAR and other invisible children of the window are inclused when using child, and therefore we have to use child4, whereas they are not included when using first or next.
yep, it works.

Copy      Help
Acc a=acc("" "CLIENT" win("" "Shell_TrayWnd") "MSTaskSwWClass" "" 0x1000)
a.Navigate("f c4 f")
,out a.Name
,err break

Copy      Help
Acc a=acc("" "WINDOW" win("" "Shell_TrayWnd") "MSTaskSwWClass" "" 0x1000 0 0 "f f c4 f")
,out a.Name
,err break

thanks !

Forum Jump:

Users browsing this thread: 1 Guest(s)