Hi JoeWinograd,
I think I understand what you mean.
But because I want to use that ahk-program for all our users (10) I cant resp. I dont want to change Totalcommander for all of them as you suggested.
What I've and what works is
Code: Select all
; catch hwnd of active Totalcommander-Window (left or right)
WM_USER=1024
Sendmessage, WM_USER+50, 3,0, , ahk_id %vTCHandleID%
tc_hwnd := ErrorLevel
; number of elements selected in TC
LB_GETSELCOUNT = 0x0190
sendmessage, LB_GETSELCOUNT,0,0,,ahk_id %tc_hwnd%
selection_count := ErrorLevel
; catch indexes of selected elements to an array/object
LB_GETSELITEMS = 0x0191
ItemArray:=object()
VarSetCapacity(Items, selection_count * 4, 0) ; set var-capacity
sendmessage, LB_GETSELITEMS, selection_count, &items, ,ahk_id %tc_hwnd%
count_items_found:=ErrorLevel
Loop, % count_items_found
{
ItemArray[A_Index] := NumGet(Items, (A_Index - 1) * 4, "UInt") + 1
}
; read those (selected) lines from active TC-Window according above catched Line-Indexes
VarSetCapacity(row_string, 1024) ; set var-capacity
LB_GETTEXT= 0x189
results_buffer:=object()
loop, % count_items_found
{
selected_index := itemarray[a_index]-1 ; get index of lines wanted
sendmessage, LB_GETTEXT, %selected_index%, &row_string, ,ahk_id %tc_hwnd%
results_buffer[a_index] := row_string ; e.g. "winver_20180217_0809.jpg"
}
and that code gives me the name of the files as shown in the picture below (e.g. "finkzeit_2018-02-17_080525.jpg", "winver_20180217_0809.jpg", "ff_version_20180217_0809.jpg") in
results_buffer, but not that caption/title (of the active Totalcommander-window), which is the path ("n:\joma") what I need too.
- tc_problem_ahk.jpg (28.48 KiB) Viewed 2287 times
How to catch that caption/title with the hwnd (Var
tc_hwnd) I've ?
J.B.