|
本帖最后由 happytc 于 2010-12-18 20:40 编辑
一段改Total comander软件标题的小代码(如下),为什么一次也不执行呢? 系统是XPAdlibRegister("TotalCommander")
Exit
Func TotalCommander()
Local $LeftDir, $RightDir, $ActivePath, $ActiveStatus, $Date, $NewTitle
$LeftDir = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TPathPanel;INSTANCE:1]")
$LeftDir = StringReplace($LeftDir, "*.*", ">", -1)
$RightDir = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TPathPanel;INSTANCE:2]")
$RightDir = StringReplace($RightDir, "*.*", "", -1)
$ActivePath = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TMyPanel;INSTANCE:3]")
$ActivePath = StringReplace($ActivePath, ">", "", -1)
If $ActivePath = $LeftDir Then
$ActiveStatus = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TMyPanel;INSTANCE:5]")
Else
$ActiveStatus = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TMyPanel;INSTANCE:8]")
EndIf
If StringRight($ActivePath, 1) <> "" Then $ActivePath = $ActivePath & ""
$Date = @YEAR & "-" & @MON & "-" & @MDAY & "::" & @HOUR & ":" & @MIN & ":" & @SEC
$NewTitle = $ActiveStatus & " " & $ActivePath & " " & $Date
WinSetTitle("[CLASS:TTOTAL_CMD]", "", $NewTitle)
EndFunc
没办法,我只好用循环来做,它就执行了,另外问一下,两种方法有什么区别,那种更好?While 1
TotalCommander()
Sleep(250)
WEnd
Func TotalCommander()
Local $LeftDir, $RightDir, $ActivePath, $ActiveStatus, $Date, $NewTitle
$LeftDir = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TPathPanel;INSTANCE:1]")
$LeftDir = StringReplace($LeftDir, "*.*", ">", -1)
$RightDir = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TPathPanel;INSTANCE:2]")
$RightDir = StringReplace($RightDir, "*.*", "", -1)
$ActivePath = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TMyPanel;INSTANCE:3]")
$ActivePath = StringReplace($ActivePath, ">", "", -1)
If $ActivePath = $LeftDir Then
$ActiveStatus = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TMyPanel;INSTANCE:5]")
Else
$ActiveStatus = ControlGetText("[CLASS:TTOTAL_CMD]", "", "[CLASS:TMyPanel;INSTANCE:8]")
EndIf
If StringRight($ActivePath, 1) <> "" Then $ActivePath = $ActivePath & ""
$Date = @YEAR & "-" & @MON & "-" & @MDAY & "::" & @HOUR & ":" & @MIN & ":" & @SEC
$NewTitle = $ActiveStatus & " " & $ActivePath & " " & $Date
WinSetTitle("[CLASS:TTOTAL_CMD]", "", $NewTitle)
EndFunc
|
|