View previous topic :: View next topic |
Author |
Message |
Orion9

Joined: 01 Jan 2024 Posts: 903
|
(Separately) Posted: Mon Sep 29, 2025 13:54 Post subject: |
|
|
Loopback wrote: | По умолчанию ShowHint перехватывает фокус, соответственно, нажатие после вызова функции ShowPipeEx попадает в другое окно. Нужно вызывать подсказку с флагом 1, ну и таймер закрытия придется использовать (или тыкать строго в подсказку). |
Понял. Спасибо за объяснение. Но флаг 1 для меня в этой ситуации не вариант. Была идея смотреть класс активного окна, и если листер - не вызывать подсказку. Но тогда нужно принимать в расчет и быстрый просмотр на панелях. Короче, нет смысла этим загоняться, проще на Alt все повесить. Хотя Alt+1 и т.д. явно не мой аккорд. Но фича с листанием подсказки не так часто требуется, поэтому даже лучше, что на альтах будет висеть.
Loopback wrote: | Почему-то был уверен, что такой запрос поступит  |
А как иначе? Без статистики - никуда. Такие фичи только на первый взгляд кажутся бесполезными, на самом деле они информируют и украшают. |
|
Back to top |
|
 |
A55555
Joined: 06 Feb 2011 Posts: 65
|
(Separately) Posted: Mon Sep 29, 2025 16:11 Post subject: |
|
|
Orion9 wrote: | A55555 wrote: | Но на чистом файле autorun.cfg я попробовал и нет, не выгружает например вот этим
Code: | Pragma AutorunFinalizeSection
ShellExec(COMMANDER_PATH & "Everything.exe", "-exit") |
|
Но я понимаю, что это не приоритет, тем более, что сам A55555 нашел другое решение. |
Orion9
Я сегодня ещё раз проверю на новой версии и уже лучше понимая что к чему.
Orion9 wrote: | Вы попробуйте. Посмотрите, что из этого получится. Если будет смысл в таких заменах, то в будущих версиях перенесем их в файл. А если замен совсем будет мало, то можно и в коде оставить. Хотя файл, конечно, лучше. |
Спасибо, да, пока их мало, но все нужные.
Orion9 wrote: | Кстати, я вчера перед тем как всё заархивировать, сделал небольшую функцию для переключения полей подсказки, чтобы не комментировать каждый раз Pragma AutorunPluginFields, а делать это "на лету". Старая подсказка у меня по-прежнему в "JoinHint" и на нее много чего навешено, чтобы полностью от нее отказаться в пользу "MagicHint". Но в будущем, конечно, надо будет довести все до ума.
 Hidden text Code: | # Alt+F12
SetHotkeyAction /K:A /H:F12 SetHintFields
Func SetHintFields()
Local i
Static c = 1
c *= -1
Local sHint = c < 0 ? "JoinHint" : "MagicHint"
For i = 1 to 60
SetFieldsParam("Func", "C" & i, sHint)
Next
ShowRedHint("Поля подсказки " & sHint)
EndFunc
Func ShowRedHint(HintText)
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint(HintText, "", "", 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(50)
SetHintParam("ShowHint", "Reload")
EndFunc |
|
Эти дополнительные функции как альтернатива Alt+5?
Orion9 wrote: |
Переменные.
...
gHintShift - шаблон для смены "на лету", только для левой секции
....
Дополнительно шаблон в левой секции может меняться "на лету" с тем, что указан в gHintShift. Комбинация для смены Alt+5. |
|
|
Back to top |
|
 |
Orion9

Joined: 01 Jan 2024 Posts: 903
|
(Separately) Posted: Mon Sep 29, 2025 19:26 Post subject: |
|
|
A55555 wrote: | Эти дополнительные функции как альтернатива Alt+5? |
Можно так сказать. Но если точнее, это отдельная и более ранняя функция подсказки, которая может дополнительно выводить данные из wdx-плагинов и консольных утилит, например ExifTool. Код этой функции сильно перемешан с другими переменными и функциями, поэтому я не могу его сюда вставить, но чтобы вы имели какое-то представление и при этом могли извлечь пользу, могу привести небольшой пример:
 Hidden text Code: | # Alt+F12
SetHotkeyAction /K:A /H:F12 SetHintFields
Func SetHintFields()
Local i
Static c = 1
c *= -1
Local sHint = c < 0 ? "ExifHint" : "MagicHint"
For i = 1 to 60
SetFieldsParam("Func", "C" & i, sHint)
Next
ShowRedHint("Поля подсказки " & sHint)
EndFunc
Func ShowRedHint(HintText)
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint(HintText, "", "", 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(50)
SetHintParam("ShowHint", "Reload")
EndFunc
Func ExifHint(FileName, FieldIndex, UnitIndex)
If FieldIndex > gHintLines Then Return
If StrPos(FileGetAttr(FileName), "D") Then Return
Local b_CTRL = BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1)
If Not b_CTRL then b_CTRL = IsPressed (0x11)
If gHintCaps And Not b_CTRL Then Return
Static sDir = COMMANDER_PATH & "\Plugins\wlx\ExifToolView\"
Static sExe = sDir & "exiftool.exe"
If FieldIndex = 1 Then
ProcessExecGetOutput gHintPipe %sExe% ' -G -S "%FileName%"' %sDir%
Endif
Return StrPart(gHintPipe, auLF, FieldIndex)
EndFunc |
Добавьте этот код и теперь при нажатии Alt+F12 у вас будет меняться подсказка. Во второй подсказке будут отображаться данные от ExifTool, только путь к утилите нужно указать свой.
ExifTool работает на многих форматах, но больше специализируется на фото и рисунках, как подразумевает ее название. Листание страниц будет работать и с этой подсказкой, т.к. утилита выводит довольно много данных.
P.S. Хотел вам ранее об этом написать. Но если секция HintsCustomField у вас пустая (что довольно странно, если вы пользуетесь готовой сборкой), то вам нужно почитать об этом немного теорию или посмотреть другие сборки, потому что вы упускаете довольно мощный инструмент ТС по отображению подсказок. Если коротко, то можно создать шаблоны, для которых будут отображаться свои подсказки. Например, для торрент-файлов своя подсказка, а для pdf-файлов своя:
Code: | 10exts=>Торрент
10fields=Трекер: [=tctorrent.Tracker]\nРазмер: [=tctorrent.Total Size.bkMG2]\nФайлов: [=tctorrent.File Count]\nНазвание: [=tctorrent.Name]
15exts=*.pdf
15fields=Страниц: [=xpdfsearch.Number of Pages]\n[="Заголовок: "xpdfsearch.Title]\n[="Автор: "xpdfsearch.Author] |
Из плагина TCMediaInfo тоже можно вытянуть поля, и я этим пользуюсь:
Code: | 14exts=>Видео
14fields=Время: [=tcmediainfo.Duration]\nВидео: [=tcmediainfo.All video as string]\nАудио: [=tcmediainfo.All audio as string]\n[="Язык аудио: "tcmediainfo.Audio Language]\n[="Субтитры: "tcmediainfo.Text Streams]\n[="Язык субтитров: "tcmediainfo.Subtitles] |
|
|
Back to top |
|
 |
Loopback
Joined: 07 Sep 2009 Posts: 1629
|
(Separately) Posted: Mon Sep 29, 2025 20:29 Post subject: |
|
|
Украшают, ага, ну чисто елка новогодняя
Ладно, спорить не буду, моё мнение на этот счёт известно.
Тем не менее, еще после вчерашнего вопроса подумал, а насколько реально получить размер скрипта целиком в памяти. Если бы это "стоило дешево", то можно было бы и добавить, даже при том , что польза от этого примерно равна нулю. Но это действительно очень проблематично. Для отладки еще что-то можно было бы попробовать сделать, но в рабочей это громоздить совершенно нерационально.
Loopback wrote: | С загрузкой проще, поскольку можно легко оценить с помощью GetUptme, с текстом функции и без него. |
Тут я был неправ насчет GetUptime, время парсинга ей никак не оценить. Поставил таймер, загрузка и парсинг файла размером 46 Кб (1800 строк кода), на скромном ноутбучном процессоре занимает 10-15 мс. |
|
Back to top |
|
 |
A55555
Joined: 06 Feb 2011 Posts: 65
|
(Separately) Posted: Tue Sep 30, 2025 00:46 Post subject: |
|
|
Orion9
вот мой чистый Autorun.cfg
 Hidden text Code: | # Enables ModifyDialogs functionality
# Включает функционал ModifyDialogs
# LoadLibrary Plugins\Autorun_ModifyDialogs.dll
# ModifyDialogs
# Uncomment to enable additional system info
# Раскомментируйте для дополнительной системной информации
# LoadLibrary Plugins\Autorun_Sysinfo.dll
LoadLibrary Plugins\Autorun_Process.dll
# Adding current TC path to PATH environment variable
# Добавляет к переменной окружения PATH текущую папку TC
SetEnv /A PATH ;%COMMANDER_PATH%
# Enables showing of administrative shares
# Включает отображение административных шар
SendCommand cm_AdministerServer
# The block below sets COMMANDER_PROGRAM environment variable
# to corresponding TC executable path depending on it's architecture
# Блок ниже устанавливает в переменную окружения COMMANDER_PROGRAM
# путь к исполняемому файлу TC в зависимости от его архитектуры
If AUTORUN_TCARCH = 32 Then
SetEnv COMMANDER_PROGRAM %COMMANDER_PATH%\TOTALCMD.EXE
Else
SetEnv COMMANDER_PROGRAM %COMMANDER_PATH%\TOTALCMD64.EXE
EndIf
# Retrieve OS version with commandline tool. This can be relatively slow.
# Получение версии ОС с помощью командной строки Windows. Это может быть относительно медленно.
#
# LoadLibrary Plugins\Autorun_Process.dll
# ProcessExecGetOutput OSVER %COMSPEC% '/c ver'
# SetEnv COMMANDER_OSVER "%OSVER%"
# After this line all actions are performed when TC closing
# После этой строки все действия выполняются при закрытии TC
Pragma AutorunFinalizeSection
ShellExec(COMMANDER_PATH & "Everything.exe", "-exit") |
не выгружается Everything этим способом. Windows11 24H2, TC 11.51 (64 bit)
Everything.exe находится в корневой папке TC.
Orion9 wrote: | Добавьте этот код и теперь при нажатии Alt+F12 у вас будет меняться подсказка. Во второй подсказке будут отображаться данные от ExifTool, только путь к утилите нужно указать свой.
ExifTool работает на многих форматах, но больше специализируется на фото и рисунках, как подразумевает ее название. Листание страниц будет работать и с этой подсказкой, т.к. утилита выводит довольно много данных. |
Работает, спасибо, но у меня что-то сломалось и теперь в полноэкранном режиме при нажатии Alt появляется или исчезает панель TC на которой расположены меню "Файлы", "Выделение", "Навигация", "Конфигурация" и т.д.
В обычном оконном режиме при нажатии Alt подчеркиваються первые буквы этих меню.
Попробую откатится куда-то, где было нормально.
Не могу теперь листание проверить, подсказка исчезает при нажатии Alt
Возможно, в результате всех манипуляций слетел перехват кнопки Alt плагином Autorun, попробую понять.
Last edited by A55555 on Tue Sep 30, 2025 14:40; edited 4 times in total |
|
Back to top |
|
 |
AkulaBig
Joined: 03 Dec 2008 Posts: 446
|
(Separately) Posted: Tue Sep 30, 2025 06:25 Post subject: |
|
|
A55555 wrote: | вот мой чистый Autorun.cfg |
У вас Everything.exe прямо в корне ТС лежит? Не в отдельной папочке? И какая у вас версия Everything.exe? Я выше спрашивал, вы не ответили. |
|
Back to top |
|
 |
A55555
Joined: 06 Feb 2011 Posts: 65
|
(Separately) Posted: Tue Sep 30, 2025 11:14 Post subject: |
|
|
AkulaBig wrote: | A55555 wrote: | вот мой чистый Autorun.cfg |
У вас Everything.exe прямо в корне ТС лежит? Не в отдельной папочке? И какая у вас версия Everything.exe? Я выше спрашивал, вы не ответили. |
AkulaBig
Да, в корне лежит. Это автор сборки туда положил.
Версия Everything 1.4.1.1026 (x64)
Last edited by A55555 on Wed Oct 01, 2025 00:49; edited 1 time in total |
|
Back to top |
|
 |
Orion9

Joined: 01 Jan 2024 Posts: 903
|
(Separately) Posted: Tue Sep 30, 2025 20:07 Post subject: |
|
|
Ну сказать. Loopback просто вынудил затянуть пояса и сделать хотя бы тестовую версию поиска недокаченных торрентов.
 Hidden text Code: | RegisterCommand 70504 "FindTorrentParts"
Func FindTorrentParts(lParam)
If h_WinFindTorr Then
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
g_FindTorrTask = 0
Return
Endif
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
If Not FileExist(sFile) Then
ShowHint("Not exist " & sFile)
Return
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Directory " & sFile)
Return
EndIf
Static sLibName = "TCTorrent.wlx" & (auX64 ? "64" : "")
Static sLibPath = COMMANDER_PATH & "\Plugins\wlx\TCTorrent\" & sLibName
Local hDll = DllCall("LoadLibrary", "wstr", sLibPath, "handle")
If hDll = 0 Then
ShowHint("TCTorrent.wlx can't load library " & sLibPath)
Return
EndIf
Local hHandle = DllCall(sLibName & "\TorrentOpen", "wstr", sFile, "handle")
If hHandle = 0 Then
ShowHint("TCTorrent.wlx can't open file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
If DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "FileCount", "int", 0, "wstr") < 1 Then
ShowHint("Not torrent file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
h_WinFindTorr = 0
RunThread "WinFindTorrentData"
While g_FindTorrTask = 0
Sleep(50)
Wend
Local T1 = GetUptime(), T2 = T1, T3, bSpeed = false
Local j, nCount, sRes, nError, sList, sQuery, sDirs, aQuery = List(), aCount = List()
nCount = DllCall(sLibName & "\TorrentCountGet", "handle", hHandle, "wstr", "File", "uint")
For j = 0 To nCount - 1
sRes = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "File", "int", j, "wstr")
If bSpeed Then
T3 = GetUptime()
If Round(T3 - T2, 0) > 250 Then
WinSetText(sRes, h_WinFindTorr)
T2 = T3
EndIf
Else
WinSetText(sRes, h_WinFindTorr)
EndIf
aQuery.Text = FileFindEv('*\"' & sRes & '"', "", "")
nError = ERROR
If nError > 0 Then Break
aCount.Add("[" & aQuery.Count & "] " & sRes)
If aQuery.Count > 0 Then
sList &= aQuery.Text & auCRLF
sDirs &= StrReplace(aQuery.Text, sRes, "") & auCRLF
EndIf
If g_FindTorrTask = 0 Then Break
Next
T2 = Round(GetUptime() - T1, 0) / 1000
T3 = "Время поиска: " & StrFormat("%.3f", T2) & " sec"
SetHintParam("ShowHint", "Font", 10, "")
If nError = 1 Then MsgBox("Everything window not found.")
If nError = 2 Then MsgBox("IPC Everything query execution error.")
If nError > 0 Then
g_FindTorrTask = 0
Return
EndIf
Local c = 0, m = Map(), top5 = List(), sTop5, bDirs = StrLen(StrTrim(sDirs))
If g_FindTorrTask And bDirs Then
aQuery.Text = sDirs
For value In aQuery
c = 1
If m.Has(value) Then c += m.Get(value)
m.Set(value, c)
Next
EndIf
If g_FindTorrTask And bDirs Then
top5.SortMethod = 1
For key, value In m
top5.Add("[" & value & "]" & Chr(160) & key)
Next
top5.Sort(1)
For j = 0 To top5.Count - 1
sTop5 &= top5[j] & auCRLF
If j >= 5 Then Break
Next
EndIf
If g_FindTorrTask = 0 Then
MsgBox("Поиск отменен", "Autorun", 48)
Else
g_FindTorrTask = 0
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
If DllCall("DestroyWindow", "handle", h_WinFindTorr) Then h_WinFindTorr = 0
If top5.Count = 0 Then
MsgBox("Найдено: " & top5.Count & auCRLF & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3, "Autorun", 64)
Else
Local top1 = StrTrim(StrPart(top5[0], Chr(160), 2))
If BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1) Then
ShowRedHint("Автопереход к найденому")
GoToPathFromMsg(top1)
Return
EndIf
MsgBox("Найдено: " & top5.Count & auCRLF & auCRLF & sTop5 & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3 & auCRLF & auCRLF & _
"Сохранить в текстовый файл?", "Autorun", 3+64+0)
If EXTENDED = 2 Then Return
If EXTENDED = 7 Then GoToPathFromMsg(top1)
If EXTENDED = 6 Then
Local txt
txt &= top1 & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Top 5 locations:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sTop5 & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Torrent files:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= aCount.Text & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Full list:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sList
SaveDataPathToText(sFile, txt)
EndIf
EndIf
EndIf
Free(aCount, aQuery, top5, m)
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
EndFunc
Func ShowRedHint(HintText)
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint(HintText, "", "", 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(50)
SetHintParam("ShowHint", "Reload")
EndFunc |
Полный модуль с оригинальным примером от Loopback.
 Torrent.aucfg Code: | #Pragma IncludeOnce
# 70500-70599
RegisterCommand 70500 "TorrentFindData" 0
RegisterCommand 70501 "TorrentFindData" 1
RegisterCommand 70502 "GoToPathFromTextFile"
RegisterCommand 70503 "ToggleEverything"
RegisterCommand 70504 "FindTorrentParts"
RegisterCommand 70505 "TorrentSize"
Global gTorrentSize = 0, gTorrentCount = 0, gDriveInclude = "e:\;f:\;g:\;h:\;i:\;j:\"
Global h_WinFindTorr = 0
Global g_WinFindTorr = 0, g_FindTorrTask = 0
Global o_WinFindTorr = Callback("WinFindTorrProc", "hwnd;uint;wparam;lparam")
Func WinFindTorrProc(hWnd, uMsg, wParam, lParam)
Static WM_CLOSE = 0x0010
If uMsg = WM_CLOSE Then
If DllCall("DestroyWindow", "handle", hWnd) Then
h_WinFindTorr = 0
g_FindTorrTask = 0
EndIf
Return 0
EndIf
Return DllCall("CallWindowProcW", "ptr", g_WinFindTorr, _
"hwnd", hWnd, "uint", uMsg, "wparam", wParam, "lparam", lParam)
EndFunc
Func WinFindTorrentData()
Local hIco
h_WinFindTorr = DllCall("CreateWindowExW", _
"dword", 0, _
"wstr", "msctls_progress32", _
"wstr", "", _
"dword", 0x00C80000, _
"int", 200, "int", 100, "int", Scale(400), "int", Scale(50), _
"handle", AUTORUN_TCHANDLE, _
"handle", 0, "handle", 0, "ptr", 0, "handle")
If h_WinFindTorr = 0 Then Return 0
WinAlign(h_WinFindTorr, 0, DllCall("GetDesktopWindow"))
WinSetPos("", -Scale(50), "", "", 1, h_WinFindTorr)
WinSetState(5, h_WinFindTorr)
g_WinFindTorr = DllCall("SetWindowLong" & (auX64 ? "PtrW" : "W"), _
"hwnd", h_WinFindTorr, _
"int", -4, _
"long_ptr", o_WinFindTorr.Ptr, "ptr")
Static PBS_MARQUEE = 0x08, _
PBM_SETMARQUEE = 1034, _
WM_GETICON = 0x7f, _
WM_SETICON = 0x80
hIco = SendMessage(AUTORUN_TCHANDLE, WM_GETICON, 2, 0)
SendMessage(h_WinFindTorr, WM_SETICON, 0, hIco)
WinSetStyle(PBS_MARQUEE, 2, h_WinFindTorr)
SendMessage(h_WinFindTorr, PBM_SETMARQUEE, 1, 0)
WinSetText("Searching...", h_WinFindTorr)
g_FindTorrTask = 1
While g_FindTorrTask
Sleep(50)
Wend
h_WinFindTorr = 0
EndFunc
Func TorrentFindData(lParam, nMode)
If IsPressed(0x10) And Not nMode Then
SetTorrentDrives()
Return
EndIf
Local bEverything = nMode
If h_WinFindTorr Then
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
g_FindTorrTask = 0
Return
Endif
Static buf = Buffer(256)
buf.Zero()
Local nSymb = DllCall("GetLogicalDriveStringsW", "dword", buf.size, "ptr", buf.ptr)
If Not nSymb Then
MsgBox("Не удалось получить список логических дисков" & auCRLF "SYSERROR: " & SYSERROR, "Autorun")
Return
EndIf
Static aDrive = List(), aFound = List()
Local i = 0, sz, sDrives
aDrive.Count = 0
While 1
sDrive = buf.GetStr(i)
sz = StrLen(sDrive)
If sz = 0 Then break
aDrive.add(sDrive)
i = i + sz*2 + 2
Wend
sDrives = aDrive.text
#MsgBox(sDrives)
Local obj = Plugin("TCTorrent")
If ERROR <> 0 Then
ShowHint("TCTorrent.wdx plugin error " & ERROR)
Return
Endif
Local lRet = false
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
If Not FileExist(sFile) Then
ShowHint("Файл не существует " & sFile)
lRet = true
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Каталог " & sFile)
lRet = true
Else
obj.FileName = sFile
Local name = obj.GetValue(0)
Local size = obj.GetValue(2,0) # size -> bytes
Local files = obj.GetValue(1)
If files < 1 Then
ShowHint("Файл не является торрент-файлом " & sFile)
lRet = true
EndIf
Endif
Free(obj)
If lRet Then Return
IniRead gDriveInclude %COMMANDER_INI% "Autorun" "TorrentDrives" %"gDriveInclude"
If Not BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1) Then
MsgBox("Поиск данных торрента:" & auCRLF & auCRLF & _
"Имя: " & name & auCRLF & _
"Размер: " & size & auCRLF & _
"Файлов: " & files & auCRLF & auCRLF & _
"Диски поиска: " & gDriveInclude & auCRLF & auCRLF & _
"Продолжить?", "Autorun", 3+32+0)
If EXTENDED <> 6 Then Return
Endif
aFound.Count = 0
gTorrentSize = size
h_WinFindTorr = 0
gTorrentCount = 0
RunThread "WinFindTorrentData"
While g_FindTorrTask = 0
Sleep(50)
Wend
Local found
If bEverything Then
found = FileFindEv("size:" & gTorrentSize, "", "sort:3")
Local nError = ERROR
If nError = 1 Then MsgBox("Не найдено окно Everything.")
If nError = 2 Then MsgBox("Ошибка выполнения запроса к IPC Everything.")
If nError > 0 Then
g_FindTorrTask = 0
Return
EndIf
Else
For i = 0 to aDrive.Count -1
If StrPos(gDriveInclude, aDrive[i]) Then
If files > 1 Then
found &= FileFind(aDrive[i], "*.*", 1, 2, "PathList", "Func:FindTorrentDir") & auCRLF
Else
found &= FileFind(aDrive[i], "*.*", 1, 1, "PathList", "Func:FindTorrentFile") & auCRLF
EndIf
Endif
Next
EndIf
found = StrTrim(found)
aFound.Text = found
If bEverything Then gTorrentCount = aFound.Count
If g_FindTorrTask = 0 Then
If gTorrentCount = 0 Then
MsgBox("Поиск отменен" & auCRLF & auCRLF & _
"Найдено: " & gTorrentCount & auCRLF & auCRLF & found, "Autorun", 48)
Else
MsgBox("Поиск отменен" & auCRLF & auCRLF & _
"Найдено: " & gTorrentCount & auCRLF & auCRLF & found & auCRLF & auCRLF & _
"Сохранить в текстовый файл?", "Autorun", 3+48+0)
If EXTENDED = 2 Then Return
If EXTENDED = 7 Then GoToPathFromMsg(aFound[0])
If EXTENDED = 6 Then SaveDataPathToText(sFile, found)
EndIf
Else
g_FindTorrTask = 0
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
If DllCall("DestroyWindow", "handle", h_WinFindTorr) Then h_WinFindTorr = 0
If gTorrentCount = 0 Then
MsgBox("Найдено: " & gTorrentCount & auCRLF & auCRLF & found, "Autorun", 64)
Else
If BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1) Then
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint("Автопереход к найденому", 0, 0, 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(100)
SetHintParam("ShowHint", "Reload")
GoToPathFromMsg(aFound[0])
Return
EndIf
MsgBox("Найдено: " & gTorrentCount & auCRLF & auCRLF & found & auCRLF & auCRLF & _
"Сохранить в текстовый файл?", "Autorun", 3+64+0)
If EXTENDED = 2 Then Return
If EXTENDED = 7 Then GoToPathFromMsg(aFound[0])
If EXTENDED = 6 Then SaveDataPathToText(sFile, found)
EndIf
EndIf
EndFunc
Func SaveDataPathToText(Filename, DataPath)
Local file = FileChangeExt(Filename, "txt"), bGoto = false
If FileExist(file) Then
MsgBox("Файл существует" & auCRLF & auCRLF & _
file & auCRLF & auCRLF & "Перезаписать?", "Autorun", 3+32+0)
If EXTENDED <> 6 Then Return
EndIf
FileWrite(file, DataPath)
#MsgBox("Файл сохранен " & auCRLF & auCRLF & file, "Autorun", 64)
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint("Файл сохранен", 0, 0, 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(100)
SetHintParam("ShowHint", "Reload")
If bGoto Then
If RequestInfo(1000) = 1 Then
CommandExec /CD %'file'
Else
CommandExec /CD '' %'file'
Endif
Endif
EndFunc
Func GoToPathFromTextFile()
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
If Not FileExist(sFile) Then
ShowHint("Файл не существует " & sFile)
Return
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Файл является каталогом " & sFile)
Return
ElseIf FileGetExt(sFile) <> "TXT" Then
ShowHint("Расширение файла не .txt " & sFile)
Return
ElseIf FileGetSize(sFile) > 1024*2 Then
ShowHint("Размер файла больше 2 Кб " & sFile)
Return
EndIf
Local txt = FileRead(sFile)
Local target = StrPart(txt, auCRLF, 1)
If target <> "" Then
GoToPathFromMsg(target)
Else
ShowHint("Пустой путь" & target)
EndIf
EndFunc
Func GoToPathFromMsg(Target)
If FileExist(Target) Then
If RequestInfo(1000) = 2 Then
CommandExec /CD %'Target'
Else
CommandExec /CD '' %'Target'
Endif
SendCommand(4006)
If StrPos(FileGetAttr(Target), "D") Then SendCommand(2002)
Else
ShowHint("Путь не существует " & Target)
EndIf
EndFunc
Func FindTorrentFile(file)
Static T1 = GetUptime()
If Not g_FindTorrTask Then Return 0
If Round(GetUptime() - T1, 0) > 200 Then
WinSetText(" [" & gTorrentCount & "] " & file.FullPath, h_WinFindTorr)
T1 = GetUptime()
Sleep(5)
EndIf
If file.size = gTorrentSize Then
gTorrentCount += 1
Return 1
EndIf
Return 2
EndFunc
Func FindTorrentDir(file)
Static T2 = GetUptime()
If Not g_FindTorrTask Then Return 0
If Round(GetUptime() - T2, 0) > 200 Then
WinSetText(" [" & gTorrentCount & "] " & file.FullPath, h_WinFindTorr)
T2 = GetUptime()
Sleep(5)
EndIf
Local sz = FileFind(file.FullPath, "*.*", 1, 0, "TotalSize")
If sz = gTorrentSize Then
gTorrentCount += 1
Return 1
EndIf
Return 2
EndFunc
Global gVbsInputBox
Func SetTorrentDrives()
Local out, drives, vbs
IniRead drives %COMMANDER_INI% "Autorun" "TorrentDrives" %"gDriveInclude"
vbs = '/c ECHO Wscript.Echo Inputbox("Search on these disks:","Autorun","' & drives & '")>%TEMP%\~auto_0001.vbs'
ProcessExecGetOutput out %COMSPEC% %vbs%
gVbsInputBox = 1
RunThread("WinVbsInputBoxActivate")
ProcessExecGetOutput /OEM out "cscript.exe" "/nologo ~auto_0001.vbs" %TEMP%
gVbsInputBox = 0
out = StrTrim(out)
If out = "" Then Return
IniWrite %COMMANDER_INI% "Autorun" "TorrentDrives" %out%
Sleep(50)
MsgBox("Ключ сохранен.", "Autorun", 64)
EndFunc
Func WinVbsInputBoxActivate()
Local hVbs
While gVbsInputBox
hVbs = WinFind(0, "#32770", "Autorun")
If hVbs > 0 Then
WinSetState(23, hVbs)
Break
EndIf
Sleep(50)
Wend
EndFunc
Func TorrentSize(lParam)
Local T1 = GetUptime()
Local obj = Plugin("TCTorrent")
If ERROR <> 0 Then
ShowHint("TCTorrent.wdx plugin error " & ERROR)
Return
Endif
Local size = 0, files = 0
Local aSel = List()
aSel.Text = GetSelectedItems(3, 0)
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
Local lRet = false
If aSel.Count = 0 Then
If Not FileExist(sFile) Then
ShowHint("Файл не существует " & sFile)
lRet = true
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Каталог " & sFile)
lRet = true
Else
obj.FileName = sFile
files = obj.GetValue(1)
size = obj.GetValue(2,0) # size -> bytes
Free(obj)
Endif
EndIf
If lRet Then
Free(obj, aSel)
Return
EndIf
If aSel.Count > 10 Then
ShowHint("Выделено: " & aSel.Count & auCRLF & "Подсчёт времени...")
EndIf
Local j, k = 0, dirs = 0, torrs = 0
If aSel.Count > 0 Then
For j = 0 To aSel.Count - 1
sFile = sPath & aSel[j]
If FileExist(sFile) Then
k += 1
If Not StrPos(FileGetAttr(sFile), "D") Then
obj.FileName = sFile
s = obj.GetValue(2,0)
If s > 0 Then
size += s
files += obj.GetValue(1)
torrs += 1
Endif
Else
dirs += 1
Endif
EndIf
Next
sName = "S/A: " & aSel.Count & "/" & k # Selected / Available
Else
SetHintParam("ShowHint", "Font", 10, "")
ShowHint("" & sName & auCRLF & _
"Размер: " & SizeFormat(size, 1, 'G', 2, 1) & auCRLF & _
"Файлов: " & files)
Sleep(100)
SetHintParam("ShowHint", "Reload")
Free(aSel)
Return
EndIf
Local tl = Round(GetUptime() - T1, 0) / 1000
SetHintParam("ShowHint", "Font", 10, "")
ShowHint((k = aSel.Count ? "" : "Файл " & sName & auCRLF) & _
"Элементов: " & aSel.Count & auCRLF & _
"Обработано: " & torrs & auCRLF & _
"Каталогов: " & dirs & auCRLF & _
"Размер: " & SizeFormat(size, 0, 'M', 2) & auCRLF & _
"Размер: " & SizeFormat(size, 0, 'G', 2) & auCRLF & _
"Размер: " & SizeFormat(size, 0, 'T', 4) & auCRLF & _
"Файлов: " & files & auCRLF & _
"Powered by TCTorrent.wdx" & auCRLF & _
"Время операции: " & StrFormat("%.3f", tl) & " sec")
Sleep(100)
SetHintParam("ShowHint", "Reload")
Free(obj, aSel)
EndFunc
Func ToggleEverything()
If Not ProcessExist("Everything.exe") Then
CommandExec em_everything
Else
CommandExec em_everything_exit
Endif
EndFunc
Func TerminateEverything()
CommandExec em_everything_exit
EndFunc
# original function by Loopback
Func TorrentInfo(sFile)
Static aFixed = List('Name', 'TotalSize', 'FileCount', 'BlockSize', 'BlockCount', _
'Created', 'Creator', 'Hash', 'Comment', 'Encoding', _
'Multifile', 'PrivateTorrent', 'Publisher', 'PublisherURL')
Static aMulti = List('Tracker', 'Webseed', 'Error', 'File', 'CustomField')
Static sLibName = "TCTorrent.wlx" & (auX64 ? "64" : "")
Static sLibPath = COMMANDER_PATH & "\Plugins\wlx\TCTorrent\" & sLibName
Local hDll = DllCall("LoadLibrary", "wstr", sLibPath, "handle")
If hDll = 0 Then Return
Local hHandle = DllCall(sLibName & "\TorrentOpen", "wstr", sFile, "handle")
If hHandle = 0 Then
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
Local nCount, sRes
For i = 0 to aFixed.Count - 1
sRes = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", aFixed[i], "int", i, "wstr")
OutputDebugString(aFixed[i] & ": " & sRes)
Next
For i = 0 to aMulti.Count - 1
OutputDebugString(auCRLF & aMulti[i] & 's:')
nCount = DllCall(sLibName & "\TorrentCountGet", "handle", hHandle, "wstr", aMulti[i], "uint")
For j = 0 To nCount - 1
sRes = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", aMulti[i], "int", j, "wstr")
OutputDebugString(sRes)
Next
Next
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
EndFunc
Func FindTorrentParts(lParam)
If h_WinFindTorr Then
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
g_FindTorrTask = 0
Return
Endif
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
If Not FileExist(sFile) Then
ShowHint("Not exist " & sFile)
Return
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Directory " & sFile)
Return
EndIf
Static sLibName = "TCTorrent.wlx" & (auX64 ? "64" : "")
Static sLibPath = COMMANDER_PATH & "\Plugins\wlx\TCTorrent\" & sLibName
Local hDll = DllCall("LoadLibrary", "wstr", sLibPath, "handle")
If hDll = 0 Then
ShowHint("TCTorrent.wlx can't load library " & sLibPath)
Return
EndIf
Local hHandle = DllCall(sLibName & "\TorrentOpen", "wstr", sFile, "handle")
If hHandle = 0 Then
ShowHint("TCTorrent.wlx can't open file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
If DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "FileCount", "int", 0, "wstr") < 1 Then
ShowHint("Not torrent file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
h_WinFindTorr = 0
RunThread "WinFindTorrentData"
While g_FindTorrTask = 0
Sleep(50)
Wend
Local T1 = GetUptime(), T2 = T1, T3, bSpeed = false
Local j, nCount, sRes, nError, sList, sQuery, sDirs, aQuery = List(), aCount = List()
nCount = DllCall(sLibName & "\TorrentCountGet", "handle", hHandle, "wstr", "File", "uint")
For j = 0 To nCount - 1
sRes = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "File", "int", j, "wstr")
If bSpeed Then
T3 = GetUptime()
If Round(T3 - T2, 0) > 250 Then
WinSetText(sRes, h_WinFindTorr)
T2 = T3
EndIf
Else
WinSetText(sRes, h_WinFindTorr)
EndIf
aQuery.Text = FileFindEv('*\"' & sRes & '"', "", "")
nError = ERROR
If nError > 0 Then Break
aCount.Add("[" & aQuery.Count & "] " & sRes)
If aQuery.Count > 0 Then
sList &= aQuery.Text & auCRLF
sDirs &= StrReplace(aQuery.Text, sRes, "") & auCRLF
EndIf
If g_FindTorrTask = 0 Then Break
Next
T2 = Round(GetUptime() - T1, 0) / 1000
T3 = "Время поиска: " & StrFormat("%.3f", T2) & " sec"
SetHintParam("ShowHint", "Font", 10, "")
If nError = 1 Then MsgBox("Everything window not found.")
If nError = 2 Then MsgBox("IPC Everything query execution error.")
If nError > 0 Then
g_FindTorrTask = 0
Return
EndIf
Local c = 0, m = Map(), top5 = List(), sTop5, bDirs = StrLen(StrTrim(sDirs))
If g_FindTorrTask And bDirs Then
aQuery.Text = sDirs
For value In aQuery
c = 1
If m.Has(value) Then c += m.Get(value)
m.Set(value, c)
Next
EndIf
If g_FindTorrTask And bDirs Then
top5.SortMethod = 1
For key, value In m
top5.Add("[" & value & "]" & Chr(160) & key)
Next
top5.Sort(1)
For j = 0 To top5.Count - 1
sTop5 &= top5[j] & auCRLF
If j >= 5 Then Break
Next
EndIf
If g_FindTorrTask = 0 Then
MsgBox("Поиск отменен", "Autorun", 48)
Else
g_FindTorrTask = 0
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
If DllCall("DestroyWindow", "handle", h_WinFindTorr) Then h_WinFindTorr = 0
If top5.Count = 0 Then
MsgBox("Найдено: " & top5.Count & auCRLF & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3, "Autorun", 64)
Else
Local top1 = StrTrim(StrPart(top5[0], Chr(160), 2))
If BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1) Then
ShowRedHint("Автопереход к найденому")
GoToPathFromMsg(top1)
Return
EndIf
MsgBox("Найдено: " & top5.Count & auCRLF & auCRLF & sTop5 & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3 & auCRLF & auCRLF & _
"Сохранить в текстовый файл?", "Autorun", 3+64+0)
If EXTENDED = 2 Then Return
If EXTENDED = 7 Then GoToPathFromMsg(top1)
If EXTENDED = 6 Then
Local txt
txt &= top1 & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Top 5 locations:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sTop5 & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Torrent files:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= aCount.Text & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Full list:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sList
SaveDataPathToText(sFile, txt)
EndIf
EndIf
EndIf
Free(aCount, aQuery, top5, m)
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
EndFunc
Func ShowRedHint(HintText)
SetHintParam("ShowHint", "Font", 15, "Arial")
SetHintParam("ShowHint", "BackColor", 0xFF0000)
SetHintParam("ShowHint", "Text", 0xFFFFFF)
ShowHint(HintText, "", "", 1000, 1)
WinAlign(LAST_HINT_WINDOW)
Sleep(50)
SetHintParam("ShowHint", "Reload")
EndFunc |
 Кнопка TOTALCMD#BAR#DATA
70504
%COMMANDER_EXE%
Поиск торрент-данных по имени
-1
Возможно, не самый лучший и быстрый алгоритм, но зато простой в реализации и рабочий. Пока работает только с Everything и проверяет данные только по именам файлов без учета их размера. Соответственно, найти достоверный Blue-Ray таким образом вряд ли получится из-за слишком большого процента совпадения между именами файлов в разных раздачах. Но какую-то пользу можно попробовать извлечь из журнала операции, где сохраняются Топ-5 вероятных путей и полный список найденных файлов. CapsLock работает как и прежде. При влюченом CapsLock будет автопереход к первому вероятному пути, т.е. пути, где найдено больше всего имен из торрента. Большое количество файлов в торрент-файле может увеличить время поиска. Если запустить поиск на таком файле, результатов можно не дождаться ) В будущих версиях надо над этим подумать.
A55555
Вы пользуетесь готовой сборкой. Возможно, там уже назначена комбинация Alt+F12 или еще какие-то настройки влияют. Сказать трудно. |
|
Back to top |
|
 |
Orion9

Joined: 01 Jan 2024 Posts: 903
|
(Separately) Posted: Wed Oct 01, 2025 00:30 Post subject: |
|
|
Вот теперь намного лучше. Скидываю обновленную функцию и кнопку.
 Hidden text Code: | Func FindTorrentParts(lParam)
Local b_CTRL = IsPressed (0x11)
If h_WinFindTorr Then
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
g_FindTorrTask = 0
Return
Endif
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
If Not FileExist(sFile) Then
ShowHint("Not exist " & sFile)
Return
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Directory " & sFile)
Return
EndIf
Static sLibName = "TCTorrent.wlx" & (auX64 ? "64" : "")
Static sLibPath = COMMANDER_PATH & "\Plugins\wlx\TCTorrent\" & sLibName
Local hDll = DllCall("LoadLibrary", "wstr", sLibPath, "handle")
If hDll = 0 Then
ShowHint("TCTorrent.wlx can't load library " & sLibPath)
Return
EndIf
Local hHandle = DllCall(sLibName & "\TorrentOpen", "wstr", sFile, "handle")
If hHandle = 0 Then
ShowHint("TCTorrent.wlx can't open file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
If DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "FileCount", "int", 0, "wstr") < 1 Then
ShowHint("Not torrent file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
h_WinFindTorr = 0
RunThread "WinFindTorrentData"
While g_FindTorrTask = 0
Sleep(50)
Wend
Local T1 = GetUptime(), T2 = T1, T3, bSpeed = false, bSize = Not b_CTRL, sSize
Local j, nCount, sRes, nError, sList, sQuery, sDirs, aQuery = List(), aCount = List()
nCount = DllCall(sLibName & "\TorrentCountGet", "handle", hHandle, "wstr", "File", "uint")
For j = 0 To nCount - 1
sRes = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "File", "int", j, "wstr")
If bSize Then
sSize = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "FileSize", "int", j, "wstr")
EndIf
If bSpeed Then
T3 = GetUptime()
If Round(T3 - T2, 0) > 250 Then
WinSetText(sRes, h_WinFindTorr)
T2 = T3
EndIf
Else
WinSetText(sRes, h_WinFindTorr)
EndIf
If bSize Then
aQuery.Text = FileFindEv('*\"' & sRes & '" size:' & sSize, "", "")
Else
aQuery.Text = FileFindEv('*\"' & sRes & '"', "", "")
EndIf
nError = ERROR
If nError > 0 Then Break
aCount.Add("[" & aQuery.Count & "] " & sRes)
If aQuery.Count > 0 Then
sList &= aQuery.Text & auCRLF
sDirs &= StrReplace(aQuery.Text, sRes, "") & auCRLF
EndIf
If g_FindTorrTask = 0 Then Break
Next
T2 = Round(GetUptime() - T1, 0) / 1000
T3 = "Время поиска: " & StrFormat("%.3f", T2) & " sec"
SetHintParam("ShowHint", "Font", 10, "")
If nError = 1 Then MsgBox("Everything window not found.")
If nError = 2 Then MsgBox("IPC Everything query execution error.")
If nError > 0 Then
g_FindTorrTask = 0
Return
EndIf
Local c = 0, m = Map(), top5 = List(), sTop5, bDirs = StrLen(StrTrim(sDirs))
If g_FindTorrTask And bDirs Then
aQuery.Text = sDirs
For value In aQuery
c = 1
If m.Has(value) Then c += m.Get(value)
m.Set(value, c)
Next
EndIf
If g_FindTorrTask And bDirs Then
top5.SortMethod = 1
For key, value In m
top5.Add("[" & value & "]" & Chr(160) & key)
Next
top5.Sort(1)
For j = 0 To top5.Count - 1
sTop5 &= top5[j] & auCRLF
If j >= 5 Then Break
Next
EndIf
If g_FindTorrTask = 0 Then
MsgBox("Поиск отменен", "Autorun", 48)
Else
g_FindTorrTask = 0
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
If DllCall("DestroyWindow", "handle", h_WinFindTorr) Then h_WinFindTorr = 0
If top5.Count = 0 Then
MsgBox("Найдено: " & top5.Count & auCRLF & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3 & auCRLF & _
"Режим: " & (bSize ? "Имя+размер" : "Только имя"), "Autorun", 64)
Else
Local top1 = StrTrim(StrPart(top5[0], Chr(160), 2))
If BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1) Then
ShowRedHint("Автопереход к найденому")
GoToPathFromMsg(top1)
Return
EndIf
MsgBox("Найдено: " & top5.Count & auCRLF & auCRLF & sTop5 & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3 & auCRLF & _
"Режим: " & (bSize ? "Имя+размер" : "Только имя") & auCRLF & auCRLF & _
"Сохранить в текстовый файл?", "Autorun", 3+64+0)
If EXTENDED = 2 Then Return
If EXTENDED = 7 Then GoToPathFromMsg(top1)
If EXTENDED = 6 Then
Local txt
txt &= top1 & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Top 5 locations:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sTop5 & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Torrent files:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= aCount.Text & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Full list:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sList
SaveDataPathToText(sFile, txt)
EndIf
EndIf
EndIf
Free(aCount, aQuery, top5, m)
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
EndFunc |
 Hidden text TOTALCMD#BAR#DATA
70504
%COMMANDER_EXE%
Поиск торрент-данных|По имени и размеру файлов|Ctrl - Только по имени файлов
-1
Важно! Для работы нужна последняя версия TCTorrent.
Loopback
В последней версии плагина ProcessExecGetOutput сломался. У меня многие функции перестали работать. Такой код возвращает пустой результат:
Code: | global sout
ProcessExecGetOutput /OEM sout %COMSPEC% "/c SET"
msgbox(sout) |
|
|
Back to top |
|
 |
A55555
Joined: 06 Feb 2011 Posts: 65
|
(Separately) Posted: Wed Oct 01, 2025 01:14 Post subject: |
|
|
Orion9 wrote: |
A55555
Вы пользуетесь готовой сборкой. Возможно, там уже назначена комбинация Alt+F12 или еще какие-то настройки влияют. Сказать трудно. |
Orion9
Да, и не понятно почему в этой сборке Alt дублирует функцию кнопки F10.
Где б его подредактировать и убрать этот излишек.
Спасибо за поиск недокачанных торрентов, попробую завтра. |
|
Back to top |
|
 |
Loopback
Joined: 07 Sep 2009 Posts: 1629
|
(Separately) Posted: Wed Oct 01, 2025 12:50 Post subject: |
|
|
Orion9 wrote: | В последней версии плагина ProcessExecGetOutput сломался |
Так и есть, сломал в последнем обновлении. Только это не ProcessExecGetOutput виноват, а запись "/c SET", которая должна передаваться как единый строковый параметр, но /c ошибочно трактовался как переключатель.
Версия от 01.10.2025
Code: | - исправлена неправильная трактовка параметра как переключателя в командной записи
+ LoadLibrary устанавливает ERROR в 1, если плагин уже был ранее загружен
- в объекте Buffer память не выделялась изменением Size, если объект был создан с нулевым размером
- свойство Size объекта Buffer не задавало размер при работе с заданным адресом
|
|
|
Back to top |
|
 |
Orion9

Joined: 01 Jan 2024 Posts: 903
|
(Separately) Posted: Wed Oct 01, 2025 14:03 Post subject: |
|
|
Loopback
Теперь, кажется, всё работает. Но я еще вечером погоняю более тщательно. Спасибо.
A55555
Попробуйте другие сборки. Хотя вы, наверное, уже пробовали, но вдруг найдете что-то для себя. Проблема в том, что какая бы сборка ни была, а под капот лезть придется рано или поздно, и когда это происходит часть, то в итоге возникает мысль, что пора делать свою )
Попробуйте другие пути с Everyting. И разрядность другую попробуйте, т.е. 32-битную версию. Откатитесь на бэкап ТС. Что происходит с Alt трудно понять. Может кнопка какая залипла (не Alt, а Ctrl или Shift), звучит банально, но такое случается иногда. Не пользуйтесь пока полным экраном, чтобы не мешал искать причину.
На счет торрентов. Доделал функционал немного, добавив поиск только по размеру, а также добавил комментарии. Поиск по размеру фича прикольная, можно находит разрозненные и переименованные файлы из раздач. Но если в торренте много мелких файлов, то и результаты будут соответствующими - сотни и тысячи файлов.
 Hidden text Code: | Func FindTorrentParts(lParam)
# модификаторы вызова
Local b_CTRL = IsPressed (0x11), b_Shift = IsPressed (0x10)
# повторный вызов при запущенной задачи
If h_WinFindTorr Then
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
g_FindTorrTask = 0
Return
Endif
# имя файла под курсором
Local sPath = RequestCopyDataInfo("SP")
Local sName = RequestCopyDataInfo("SN")
Local sFile = sPath & sName
# файл не существует или является каталогом
If Not FileExist(sFile) Then
ShowHint("File doesn't exist " & sFile)
Return
ElseIf StrPos(FileGetAttr(sFile), "D") Then
ShowHint("Not a torrent file " & sFile)
Return
EndIf
# путь к библиотеке плагина
Static sLibName = "TCTorrent.wlx" & (auX64 ? "64" : "")
Static sLibPath = COMMANDER_PATH & "\Plugins\wlx\TCTorrent\" & sLibName
# не удалось загрузить библиотеку
Local hDll = DllCall("LoadLibrary", "wstr", sLibPath, "handle")
If hDll = 0 Then
ShowHint("TCTorrent.wlx can't load library " & sLibPath)
Return
EndIf
# библиотеке не удалось открыть файл
Local hHandle = DllCall(sLibName & "\TorrentOpen", "wstr", sFile, "handle")
If hHandle = 0 Then
ShowHint("TCTorrent.wlx can't open file " & sFile)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
# файл не является торрент-файлом
Local nFiles
nFiles = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "FileCount", "int", 0, "wstr")
If nFiles < 1 Then
ShowHint("Corrupt torrent file " & sFile)
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
# окно прогресса операции
h_WinFindTorr = 0
RunThread "WinFindTorrentData"
While g_FindTorrTask = 0
Sleep(50)
Wend
# локальные переменные
Local T1 = GetUptime(), T2 = T1, T3, bSpeed = 0
Local bName = Not b_Shift, bSize = Not b_CTRL, sSize, sMode
Local j, nCount, sRes, nError, sList, sDirs, aQuery = List(), aCount = List()
If bName And bSize Then
sMode = '«Имя и размер»'
ElseIf bName Then
sMode = '«Только имя»'
Else
sMode = '«Только размер»'
EndIf
# количество файлов в торренте
nCount = DllCall(sLibName & "\TorrentCountGet", "handle", hHandle, "wstr", "File", "uint")
# перечисление файлов в торренте
For j = 0 To nCount - 1
# имя файла
sRes = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "File", "int", j, "wstr")
# размер файла
If bSize Then
sSize = DllCall(sLibName & "\TorrentGet", "handle", hHandle, "wstr", "FileSize", "int", j, "wstr")
EndIf
# меньше сообщений окну прогресса
If bSpeed Then
T3 = GetUptime()
If Round(T3 - T2, 0) > 250 Then
WinSetText(sRes, h_WinFindTorr)
T2 = T3
EndIf
Else
WinSetText(sRes, h_WinFindTorr)
EndIf
# запрос к Everything
If bName And bSize Then
aQuery.Text = FileFindEv('*\"' & sRes & '" size:' & sSize, "", "")
ElseIf bName Then
aQuery.Text = FileFindEv('*\"' & sRes & '"', "", "")
Else
aQuery.Text = FileFindEv('size:' & sSize, "", "")
EndIf
# ошибка запроса
nError = ERROR
If nError > 0 Then Break
# обработка запроса
aCount.Add("[" & aQuery.Count & "] " & sRes)
If aQuery.Count > 0 Then
sList &= aQuery.Text & auCRLF
If nFiles > 1 Then
sDirs &= StrReplace(aQuery.Text, sRes, "") & auCRLF
Else
sDirs &= aQuery.Text & auCRLF
EndIf
EndIf
# опрерация прервана закрытием окна прогресса
If g_FindTorrTask = 0 Then Break
Next
If nError = 1 Then MsgBox("Everything window not found.")
If nError = 2 Then MsgBox("IPC Everything query execution error.")
If nError > 0 Then
g_FindTorrTask = 0
Free(aCount, aQuery)
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
Return
EndIf
Local c = 0, m = Map(), top5 = List(), sTop5, bDirs = StrLen(StrTrim(sDirs))
# суммирование путей при непустом результате
If g_FindTorrTask And bDirs Then
aQuery.Text = sDirs
For value In aQuery
c = 1
If m.Has(value) Then c += m.Get(value)
m.Set(value, c)
Next
EndIf
# сортировка путей по убыванию
If g_FindTorrTask And bDirs Then
top5.SortMethod = 1
For key, value In m
top5.Add("[" & value & "]" & Chr(160) & key)
Next
top5.Sort(1)
# выбор верхних пяти путей
For j = 0 To top5.Count - 1
sTop5 &= top5[j] & auCRLF
If j >= 5 Then Break
Next
EndIf
c = top5.Count
Local top1, files = aCount.Text
If c > 0 Then top1 = StrTrim(StrPart(top5[0], Chr(160), 2))
# освобождение объектов и библиотеки
Free(aCount, aQuery, top5, m)
DllCall(sLibName & "\TorrentClose", "handle", hHandle)
DllCall("FreeLibrary", "handle", hDll)
# время операции
T2 = Round(GetUptime() - T1, 0) / 1000
T3 = "Время поиска: " & StrFormat("%.3f", T2) & " sec"
If g_FindTorrTask = 0 Then
MsgBox("Поиск отменен", "Autorun", 48)
Else
# закрытие окна прогресса
g_FindTorrTask = 0
SendMessage(h_WinFindTorr, 0x0010, 0, 0)
If DllCall("DestroyWindow", "handle", h_WinFindTorr) Then h_WinFindTorr = 0
# ничего не найдено
If c = 0 Then
MsgBox("Найдено: " & c & auCRLF & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3 & auCRLF & _
"Режим: " & sMode, "Autorun", 64)
Else
# проверка CapsLock
If BitAND(DllCall("GetKeyState", "int", 0x14, "short"), 1) Then
ShowRedHint("Автопереход к найденному")
GoToPathFromMsg(top1)
Return
EndIf
MsgBox("Найдено: " & c & auCRLF & auCRLF & sTop5 & auCRLF & _
"Торрент: " & nCount & " файлов" & auCRLF & T3 & auCRLF & _
"Режим: " & sMode & auCRLF & auCRLF & _
"Сохранить в текстовый файл?", "Autorun", 3+64+0)
If EXTENDED = 2 Then Return
If EXTENDED = 7 Then GoToPathFromMsg(top1)
If EXTENDED = 6 Then
Local txt
txt &= top1 & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Top 5 locations:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sTop5 & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Torrent files:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= files & auCRLF & auCRLF
txt &= "-----------------" & auCRLF
txt &= "Full list:" & auCRLF
txt &= "-----------------" & auCRLF
txt &= sList
SaveDataPathToText(sFile, txt)
EndIf
EndIf
EndIf
EndFunc |
 Hidden text TOTALCMD#BAR#DATA
70504
%COMMANDER_EXE%
Поиск торрент-данных|По именам и размерам файлов|Ctrl - Только по именам файлов|Shift - Только по размерам
-1
|
|
Back to top |
|
 |
yozhik

Joined: 04 May 2014 Posts: 308 Location: Электросталь
|
(Separately) Posted: Wed Oct 01, 2025 14:21 Post subject: |
|
|
A55555
В связи с обсуждением невыключающегося Everything: иногда похожие истории случаются при несоответствии прав. Например, когда утилита, запущенная от простого пользователя пытается завершить процесс, запущенный от админа. На всякий случай гляньте, всё ли у Вас в этом плане ровно. _________________ Amo ergo sum |
|
Back to top |
|
 |
Orion9

Joined: 01 Jan 2024 Posts: 903
|
(Separately) Posted: Wed Oct 01, 2025 23:19 Post subject: |
|
|
Скорее всего проблема в самой строке:
Code: | ShellExec(COMMANDER_PATH & "Everything.exe", "-exit") |
Должна быть косая черта:
Code: | ShellExec(COMMANDER_PATH & "\Everything.exe", "-exit") |
Как-то я упустил этот момент сразу, но сейчас попробовал и увидел.
Кстати, чистый конфиг имеется в виду именно чистый, т.е. без всего лишнего. Можно прямо на двух строках сделать autorun.cfg:
Code: | ShellExec(COMMANDER_PATH & "\Everything.exe", "-startup")
Pragma AutorunFinalizeSection
ShellExec(COMMANDER_PATH & "\Everything.exe", "-exit") |
Добавлено спустя 1 час 8 минут:
Loopback
Проверил. Вроде бы всё, что мне нужно, работает, и это очень хорошо. Постепенно всё остальное также проверится, включая ТСх64. Хочется уже стабильной версии на долгое время ) |
|
Back to top |
|
 |
A55555
Joined: 06 Feb 2011 Posts: 65
|
(Separately) Posted: Thu Oct 02, 2025 00:52 Post subject: |
|
|
yozhik wrote: | A55555
В связи с обсуждением невыключающегося Everything: иногда похожие истории случаются при несоответствии прав. Например, когда утилита, запущенная от простого пользователя пытается завершить процесс, запущенный от админа. На всякий случай гляньте, всё ли у Вас в этом плане ровно. |
yozhik
у меня всё Админ, и TC и Everything.
Orion9
подскажите пожалуйста для нового кода поиска по торрент файлу, для кнопки 70504 в функцию Func FindTorrentParts(lParam)
как правильно прописать аналог этого варианта запуска Everything
Code: | If bEverything Then CommandExec em_everything |
и
Code: | #ВЫХОД ИЗ EVERYTHING
If bEverything Then CommandExec em_everything_exit |
в функции для кнопки 70504 очень много локальных переменных.
Снова хочу по аналогии со старым поиском через Everything, чтоб и запускалось и выходило сразу.
Пока решил через вами исправленную команду, запуск и выход в рамках Func FindTorrentParts(lParam).
В самом начале этой функции запуск
Code: | ShellExec(COMMANDER_PATH & "\Everything.exe", "-startup") |
и в нескольких местах потом выход
Code: | ShellExec(COMMANDER_PATH & "\Everything.exe", "-exit") |
нормально работает.
Старые варианты поиска работают.
"Старый_Обычный" стал немного дольше искать.
"Старый_Everything" так и летает.
В новом коде всё как вы говорите заработало, когда CapsLock_ВКЛ тогда не спрашивает ничего, когда CapsLock_ВЫКЛ выскакивает предложение сохранить в TXT.
Мне удобнее наоборот.
Подскажите пожалуйста, как поменять наоборот и для старых и для нового поиска, при CapsLock_ВЫКЛ ничего не спрашивает?
Новый поиск 70504 летает, но есть моменты.
Например раздача https://rutracker.org/forum/viewtopic.php?t=6671175
Одиночный файл без папки, я скачал от неё примерно 9% и поставил паузу.
Этот файл, если просто 70504 не будет найден. Выскакивает сообщение
 Hidden text
Если 70504+Ctrl (по имени) найдет.
Если 70504+Shift (по размеру) НЕнайдет.
Т.е. получается при обычном без дополнительной клавиши поиске 70504 доминирует поиск по размеру, не пытаясь попробовать по имени.
При этом например частично скачанная раздача https://rutracker.org/forum/viewtopic.php?t=6694494 (файлы 03. 04. 05. )
Всё нормально находит. Правда тут без всяких пауз, просто по-нормальному частично скачано.
И полноценный Blu-Ray с мелкими файлами в т.ч. https://rutracker.org/forum/viewtopic.php?t=3533230
полностью скачанный.
70504 впадает в бесконечный поиск, но не каждый раз. Закономерность не понятна на данный момент, бывает спокойно всё находит и достаточно быстро.
Orion9 wrote: | Скорее всего проблема в самой строке:
Code: | ShellExec(COMMANDER_PATH & "Everything.exe", "-exit") |
Должна быть косая черта:
Code: | ShellExec(COMMANDER_PATH & "\Everything.exe", "-exit") |
Как-то я упустил этот момент сразу, но сейчас попробовал и увидел. |
Orion9
заработало в вашем исправленном варианте
Code: | ShellExec(COMMANDER_PATH & "\Everything.exe", "-exit") |
даже не на чистом Autorun.cfg.
Спасибо.
Last edited by A55555 on Fri Oct 03, 2025 00:12; edited 3 times in total |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|