智能跳转---TC资源管理器

来源:互联网 发布:黑马java全套视频教程 编辑:程序博客网 时间:2024/06/05 10:44

智能跳转---TC资源管理器

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;作者:天甜;QQ:105224583;一花一世界,一叶一枯荣,心无挂碍,无挂碍故,无有恐怖,远离颠倒梦想,究竟涅盘。;更新于:2016-10-10-20-36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Process, Priority,,high;脚本高优先级#NoTrayIcon ;隐藏托盘图标#NoEnv;不检查空变量是否为环境变量#Persistent;让脚本持久运行(关闭或ExitApp)#SingleInstance Force;跳过对话框并自动替换旧实例#WinActivateForce;强制激活窗口#MaxHotkeysPerInterval 200;时间内按热键最大次数SetBatchLines -1;脚本全速执行SetControlDelay 0;控件修改命令自动延时CoordMode Menu Window;坐标相对活动窗口SendMode Input;更速度和可靠方式发送键盘点击SetTitleMatchMode 2;窗口标题模糊匹配;SetTitleMatchMode,RegExDetectHiddenWindows On;显示隐藏窗口SetWorkingDir %A_ScriptDir%;当前脚本所在目录的绝对路径.不包含最后的反斜线(根目录同样如此);A_ScriptDir指的是D:\zxh\QuickZ\Apps;另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件 ahk_class #32770GroupAdd,Window32770,另存为 ahk_class #32770GroupAdd,Window32770,保存 ahk_class #32770GroupAdd,Window32770,复制 ahk_class #32770GroupAdd,Window32770,新建 ahk_class #32770GroupAdd,Window32770,打开 ahk_class #32770GroupAdd,Window32770,图形另存为 ahk_class #32770GroupAdd,Window32770,文件打开 ahk_class #32770GroupAdd,Window32770,打开文件 ahk_class #32770GroupAdd,Window32770,保存副本 ahk_class #32770GroupAdd,Window32770,上传 ahk_class #32770GroupAdd,Window32770,选择文件 ahk_class #32770GroupAdd,Window32770,插入图片 ahk_class #32770GroupAdd,Window32770,导入 ahk_class #32770global this_title=global zParam;~ OnMessage(0x5555, "MsgMonitor");在某些程序中自动切换中文,某些英文注册个窗口钩子然后监听系统消息Gui +LastFound +hwndhwndshellwindowDllCall( "RegisterShellHookWindow", "UInt",hwndshellwindow )OnMessage( DllCall( "RegisterWindowMessage", "Str", "SHELLHOOK" ), "SwitchMessage" )return;~ MsgMonitor(wParam, lParam, msg);~ {    ;~ zParam = %wParam%;~ }^+!1::zParam := 1^+!0::zParam := 0SwitchMessage( wParam,lParam ) ;{{If ( wParam != 1 );新开窗口{If WinActive("ahk_class TTOTAL_CMD"){WinWaitNotActive ahk_class TTOTAL_CMDSendMessage 1074, 21, 0, , ahk_class TTOTAL_CMDControlGetText, varPathInTC, , ahk_id %ErrorLevel%StringReplace, this_title, varPathInTC, >, \IfWinExist ahk_group Window32770{WinWaitActive ahk_group Window32770, , 2if !ErrorLevel;IfWinActive ahk_group Window32770{ControlClick, Edit1, ASleep, 100ControlSetText, Edit1, %this_title%, ASleep, 50ControlSend, Edit1, {Enter}, A}elsereturn}elsereturnreturn}If WinActive("ahk_class CabinetWClass"){WinWaitNotActive ahk_class CabinetWClassWinGetTitle, this_title, ahk_class CabinetWClass;“文件夹选项”,“查看”,“在标题栏显示完整路径”,“确定”,显示完整路径if this_title=桌面this_title=%A_Desktop%;if this_title=库\文档;this_title=%A_MyDocuments%IfWinExist ahk_group Window32770{WinWaitActive ahk_group Window32770, , 2if !ErrorLevel;IfWinActive ahk_group Window32770{ControlClick, Edit1, ASleep, 100ControlSetText, Edit1, %this_title%, ASleep, 50ControlSend, Edit1, {Enter}, A}elsereturn}elsereturnreturn}If WinActive("ahk_class SciTEWindow"){if zParam = 1{OCR_IBEAM=32513hbeam := DllCall("LoadCursorFromFile","Str","D:\zxh\QuickZ\User\Icons\zzx.cur")DllCall( "SetSystemCursor", Uint,hbeam, Int,OCR_IBEAM )}if zParam = 0{SPI_SETCURSORS := 0x57DllCall("SystemParametersInfo", "UInt", SPI_SETCURSORS, "UInt", 0, "UInt", 0, "UInt", 0)}WinWaitNotActive ahk_class SciTEWindow{SPI_SETCURSORS := 0x57DllCall("SystemParametersInfo", "UInt", SPI_SETCURSORS, "UInt", 0, "UInt", 0, "UInt", 0)}return}}};}>!o::Send, ^oWinWaitActive ahk_class #32770ControlFocus, Edit1, Asend,{Backspace}sleep 100ControlSetText, Edit1, %this_title%, ASleep, 50ControlSend, Edit1, {Enter}, Areturn>!l::Send, ^+sWinWaitActive ahk_class #32770ControlFocus, Edit1, Asend,{Backspace}sleep 100ControlSetText, Edit1, %this_title%, ASleep, 50ControlSend, Edit1, {Enter}, Areturn>!n::Send, ^nWinWaitActive ahk_class #32770ControlFocus, Edit1, Asend,{Backspace}sleep 100ControlSetText, Edit1, %this_title%, ASleep, 50ControlSend, Edit1, {Enter}, Areturn;~ ^+s::;~ Send ^+s    ;~ WinWaitActive ahk_class #32770;~ ControlFocus, Edit1, A;~ send,{Backspace};~ sleep 100;~ ControlSetText, Edit1, %this_title%, A;~ Sleep, 50;~ ControlSend, Edit1, {Enter}, A;~ return#IfWinActive, ahk_class #32770^g::;发送最后 TC or 资管 路径到32770ControlClick, Edit1, ASleep, 100ControlSetText, Edit1, %this_title%, ASleep, 100ControlSend, Edit1, {Enter}, Areturn^e:: GoSub,Sub_SendCurDiagPath2Exp;在系统资管中打开对话框的路径^t:: GoSub,Sub_SendCurDiagPath2Tc;在TC中打开对话框的路径;~ Space & t:: GoSub,Sub_SendCurDiagPath2Tc#If;将Explorer中路径发送到对话框Sub_SendExpCurPath2Diag:{WinActivate ahk_class CabinetWClassWinGetTitle, Title, ahk_class CabinetWClass;打开“文件夹选项”,切换到“查看”选项卡,在高级设置列表框中勾选“在标题栏显示完整路径”,单击“确定”按钮使设置生效,现在访问文件夹路径时就会在左上角的标题栏显示完整路径if Title=桌面Title=%A_Desktop%Send !{Tab}ControlFocus, Edit1, Asend,{Backspace}sleep 100ControlSetText, Edit1, %Title%,Asend,{enter}return};将tc中路径发送到对话框Sub_SendTcCurPath2Diag:{clipraw:=ClipboardClipboard =PostMessage, 1075, 2029,0,, ahk_class TTOTAL_CMDClipWait, 1srcDIR := ClipboardClipboard:=clipraw;再发送剪贴板路径到控件ControlFocus, Edit1, Asend,{Backspace}sleep 100ControlSetText, Edit1, %srcDIR%,Asend,{enter}return};将tc中路径发送到对话框-备份Sub_SendTcCurPath2Diag2:{;将剪贴板中内容作为文件名    B_Clip2Name := falseB_ChangeDiagSize := true;先获取TC中当前路径clip:=ClipboardClipboard =    ;TC_Msg := 1075,cm_CopySrcPathToClip 2029PostMessage, 1075, 2029,0,, ahk_class TTOTAL_CMDClipWait, 1srcDIR := ClipboardClipboard:=clip;再发送剪贴板路径到控件ControlFocus, Edit1, Asend,{Backspace}sleep 100ControlSetText, Edit1, %srcDIR%,Asend,{enter};msgbox %clip%if(B_Clip2Name){Sleep 100ControlSetText, Edit1, %clip%,A};ControlSetText, Edit1, %text%,Aif(B_ChangeDiagSize){;WinGetPos, xTB, yTB,lengthTB,hightTB, ahk_class Shell_TrayWnd;改变对话框大小,省事就直接移动到100,100的位置,然后85%屏幕大小,否则就要详细结算任务栏在上下左右的位置WinMove, A,,80,80, A_ScreenWidth * 0.85, A_ScreenHeight * 0.85}return};在TC中打开对话框的路径Sub_SendCurDiagPath2Tc:{WinGetText, CurWinAllTextLoop, parse, CurWinAllText, `n, `r{If RegExMatch(A_LoopField, "^地址: "){curDiagPath := SubStr(A_LoopField,4)break}}{DiagPath := % curDiagPathWinActivate ahk_class TTOTAL_CMDPostMessage 1075, 3001, 0, , AHK_CLASS TTOTAL_CMDControlSetText, Edit1, cd %DiagPath%, ahk_class TTOTAL_CMDSleep 400ControlSend, Edit1, {Enter}, ahk_class TTOTAL_CMD}return};在系统资管中打开对话框的路径Sub_SendCurDiagPath2Exp:{WinGetText, CurWinAllTextLoop, parse, CurWinAllText, `n, `r{If RegExMatch(A_LoopField, "^地址: "){curDiagPath := SubStr(A_LoopField,4)break}}{DiagPath := % curDiagPathrun explorer.exe %DiagPath%}return}^F12::Reload^F11::ExitApp


0 0