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

Code:
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)
,title.getwintext(hwnd)
,cls.getwinclass(hwnd)
,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")
#33
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.
#34
What text is in s?
#35
sorry i didnt see one of your posts the code you gave worked great thanks so much

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

Code:
Copy      Help
Acc a=acc("Ausgeführte Anwendungen" "TOOLBAR" win("" "Shell_TrayWnd") "ToolbarWindow32" "" 0x1001)
a.Navigate("first");
rep
,out a.Name
,a.Navigate("next")
,err break

how to navigate to it when using the parent as start to avoid the language problem ?
Code:
Copy      Help
Acc a=acc("" "CLIENT" win("" "Shell_TrayWnd") "MSTaskSwWClass" "" 0x1000)
pi
#39
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.
#40
yep, it works.

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

or
Code:
Copy      Help
Acc a=acc("" "WINDOW" win("" "Shell_TrayWnd") "MSTaskSwWClass" "" 0x1000 0 0 "f f c4 f")
rep
,out a.Name
,a.Navigate("n")
,err break


thanks !
pi


Forum Jump:


Users browsing this thread: 2 Guest(s)