Code: Select all
SendInput %Name%
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
SendInput %Name%
Code: Select all
Clipboard := YourFileName
PostMessage, 0x433, 2033, 0,,ahk_class TTOTAL_CMD ; Load selection from clipboard
PostMessage, 0x433, 2049, 0,,ahk_class TTOTAL_CMD ; Go to first entry in the list
PostMessage, 0x433, 2053, 0,,ahk_class TTOTAL_CMD ; Go to next selected file
PostMessage, 0x433, 524, 0,,ahk_class TTOTAL_CMD ; Clear selection
Code: Select all
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Private Declare PtrSafe Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As LongPtr, ByVal wparam As LongPtr, ByVal lParam As LongPtr) As LongPtr
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As Long, ByVal wparam As Long, lParam As Any) As LongPtr
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If (Target.Count = 1) Then
ThisRowNum = Target.Row
ThisValue = Cells(ThisRowNum, 1).Value
a = StoreData(ThisValue)
' go to file
TC_Hwnd = FindWindow("TTOTAL_CMD", vbNullString)
RST = SendMessage(TC_Hwnd, 1075, 2033, 0) 'cm_LoadSelectionFromClip=2033;Read file selection from clipboard
RST = SendMessage(TC_Hwnd, 1075, 2049, 0) 'cm_GoToFirstEntry=2049;Place cursor on first folder or file
RST = SendMessage(TC_Hwnd, 1075, 2053, 0) 'cm_GoToNextSelected=2053;Go to next selected file
RST = SendMessage(TC_Hwnd, 1075, 524, 0) 'cm_ClearAll=524;Unselect all (files+folders)
End If
End Sub
Function StoreData(varText As Variant) As String
Dim objCP As Object
Set objCP = CreateObject("HtmlFile")
objCP.ParentWindow.ClipboardData.SetData "text", varText
End Function
Code: Select all
C:\Users\xxxxxx\Desktop\00cfe0de-da79-4421-a269-5c3bdea08523.mhtml
C:\Users\xxxxxx\Desktop\00e5698f-9184-436d-a2a6-ef653cc7a1d2.mhtml
C:\Users\xxxxxx\Desktop\00eddb01-105d-4422-8d46-a0f6d8d72b9e.mhtml
C:\Users\xxxxxx\Desktop\00f02f48-8d6d-44cc-a2e9-c3611b16542c.mhtml
C:\Users\xxxxxx\Desktop\00f52e72-e8e2-427b-83b3-f04c32896db3.mhtml
C:\Users\xxxxxx\Desktop\0a0a0bf4-e1e9-4c04-8347-6f0587efa648.mhtml
C:\Users\xxxxxx\Desktop\0a6d9dcf-b99b-4efb-bc7c-27015e4e8dca.mhtml
C:\Users\xxxxxx\Desktop\0a31e3a5-1386-4086-826e-17b162d076a1.mhtml
C:\Users\xxxxxx\Desktop\0a708cea-556d-4089-ab5a-ab1b40a42be9.mhtml
C:\Users\xxxxxx\Desktop\0a7722dd-e8a5-4036-9250-19e0932fe2a9.mhtml
C:\Users\xxxxxx\Desktop\0a37994b-fe75-430e-ad0b-0856e1a0bb28.mhtml
C:\Users\xxxxxx\Desktop\0a268380-4bf9-4912-a986-c51745a82968.mhtml
C:\Users\xxxxxx\Desktop\0ab3db39-af4d-4c5f-bbaa-408f1cafe4a5.mhtml
C:\Users\xxxxxx\Desktop\0ad763ad-9f67-44c9-b511-4cef84b1f124.mhtml
C:\Users\xxxxxx\Desktop\0af70916-1565-41f6-9d63-1a17ff68d4ed.mhtml
Please find an answer, based on the internal commands as requested, in the dedicated topic that you had cleated:valuex wrote: 2024-02-01, 14:14 UTC Also, if possible, it would be better to have an internal command to like 'cm_LoadSelectionFromClip...