尝试着将这个 脚本转化成了ahk_v2 版,但没有产生任何效果。
请坛子里的高手帮忙诊断下,谢谢。
F1::
{
SendTCUserCommand("em_savealltabs")
}
SendTCUserCommand(Command)
{
; https://www.ghisler.ch/wiki/index.php?title=AutoHotkey:_Send_a_user_command_to_Total_Commander
If (Command !="")
{
CopyDataStruct:= Buffer(3*A_PtrSize) ; Set up the structure's memory area.
dwData := Ord("E") + 256 * Ord("M")
NumPut("Ptr", dwData, CopyDataStruct, 0)
cbData := (StrLen(Command) + 1) *2 ;SizeInBytes
NumPut( "UInt",cbData, CopyDataStruct, A_PtrSize) ; OS requires that this be done.
NumPut("Ptr", StrPtr(Command), CopyDataStruct, A_PtrSize * 2 ) ; Set lpData to point to the string itself.
SendMessage( 0x4a, 0, CopyDataStruct,, "ahk_class TTOTAL_CMD") ; 0x4a is WM_COPYDATA. Must use Send not Post. }
}
}
user.ini 中的配置
[em_savealltabs]
button=wcmicons.dll,10
cmd=SAVETABS2
param=%COMMANDER_PATH%\SAVETABS2.tab