#NoEnv #NoTrayIcon #Persistent #KeyHistory, 0 #SingleInstance, force ListLines, Off SetTimer, mTimer, 200 mTimer: If WinActive("ahk_class TTOTAL_CMD") { MouseGetPos,,,, mControl if ( mControl ~= "ListBox" ) { WinGet, TCHWND, ID, ahk_class TTOTAL_CMD SeparateTree := 0 Loop, 3 { ControlGetText, TMyText%A_Index%, TMyListBox%A_Index%, ahk_id %TCHWND% ControlGetText, LCLText%A_Index%, LCLListBox%A_Index%, ahk_id %TCHWND% if ( TMyText%A_Index% = "W_TreeList2" || LCLText%A_Index% = "W_TreeList2" ) { SeparateTree := 2 break } else if ( TMyText%A_Index% = "W_TreeList1" || LCLText%A_Index% = "W_TreeList1" ) SeparateTree := 1 } Loop, 3 { LB%A_Index% := "ListBox" (SeparateTree + A_Index) } if ( mControl ~= LB1 ) PostMessage, 1075, 4002,,, ahk_class TTOTAL_CMD else if ( mControl ~= LB3 ) PostMessage, 1075, 4001,,, ahk_class TTOTAL_CMD else if ( mControl ~= LB2 ) { WinGet, TCControls, ControlList, ahk_id %TCHWND% TCFTPMode := 0 Loop, Parse, TCControls, `n, `r { if ( A_LoopField ~= LB3 ) { TCFTPMode := 1 break } } PostMessage, 1075, 400 (TCFTPMode="1" ? 2:1),,, ahk_class TTOTAL_CMD } } } Exit, (mControl) And mControl:="" |