博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
浏览器自动跳转
阅读量:7092 次
发布时间:2019-06-28

本文共 3468 字,大约阅读时间需要 11 分钟。

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.  ; #Warn  ; Enable warnings to assist with detecting common errors.  SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.  SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.  #SingleInstance,force  Menu, Tray, Icon, shell32.dll, 151;另存为|保存|复制|新建|打开|图形另存为|文件打开|保存副本|上传|选择文件 ahk_class #32770  GroupAdd,Window32770,另存为 ahk_class #32770  GroupAdd,Window32770,保存 ahk_class #32770  GroupAdd,Window32770,复制 ahk_class #32770  GroupAdd,Window32770,新建 ahk_class #32770  GroupAdd,Window32770,打开 ahk_class #32770  GroupAdd,Window32770,图形另存为 ahk_class #32770  GroupAdd,Window32770,文件打开 ahk_class #32770  GroupAdd,Window32770,打开文件 ahk_class #32770  GroupAdd,Window32770,保存副本 ahk_class #32770  GroupAdd,Window32770,上传 ahk_class #32770  GroupAdd,Window32770,选择文件 ahk_class #32770  GroupAdd,Window32770,插入图片 ahk_class #32770  GroupAdd,Window32770,导入 ahk_class #32770  GroupAdd,Window32770,置入嵌入对象 ahk_class #32770  ;~ ----------------------------------------------------GroupAdd,Window32770 , ahk_class bosa_sdm_Microsoft Office Word 11.0GroupAdd, Window32770 , ahk_class bosa_sdm_XL9GroupAdd, Window32770 , ahk_class bosa_sdm_Mso96 ;在某些程序中自动切换中文,某些英文 注册个窗口钩子然后监听系统消息  Gui +LastFound +hwndhwndshellwindow  DllCall( "RegisterShellHookWindow", "UInt",hwndshellwindow )  OnMessage( DllCall( "RegisterWindowMessage", "Str", "SHELLHOOK" ), "SwitchMessage" )  return     SwitchMessage( wParam,lParam ) ;{ {     if ( wParam != 1 ) ;新开窗口     {         if WinActive("ahk_class CabinetWClass") ;若激活了桌面;         {             WinWaitNotActive ahk_class CabinetWClass ;等待桌面失活;             ;以下三种方法是获取地址栏文本,也就是路径;             ; 方法一             ;WinGetTitle, this_title, ahk_class CabinetWClass ;“文件夹选项”,“查看”,“在标题栏显示完整路径”,“确定”,显示完整路径             ; 方法二             ;hExplorer := DllCall("FindWindowEx", Int, 0, Int, 0, Str, "CabinetWClass", Int, 0)             ;hAddressBar := DllCall("FindWindowEx", Int, hExplorer, Int, 0, Str, "ShellTabWindowClass", Int, 0)             ;ControlGetText, path, , ahk_id %hAddressBar%             ; 方法三             ControlGetText, this_title, ToolbarWindow322, ahk_class CabinetWClass             this_title := StrReplace(this_title, "地址:", "")             if this_title=桌面                 this_title=%A_Desktop%             ;if this_title=库\文档             ;this_title=%A_MyDocuments%             IfWinExist ahk_group Window32770             {                 WinWaitActive ahk_group Window32770, , 2                 if !ErrorLevel                 {                ;IfWinActive ahk_group Window32770                 WinGetClass,w_Class,A                    if w_Class not contains bosa_sdm_  ;Office对话框                        {                            ControlFocus, Edit1, A                             ControlSetText, Edit1, %this_title%, A                             Sleep, 50                             ControlSend, Edit1, {Enter}, A                          }                      else                        {                          ControlSetText, RichEdit20W2, %this_title%, A                             Sleep, 50                             ControlSend, RichEdit20W2, {Enter}, A                          }}                  else                      return              }              else                  return              return          }  }  }

 

转载于:https://www.cnblogs.com/zhanglei1371/p/6664835.html

你可能感兴趣的文章
数据科学面临的共同挑战有哪些?
查看>>
跨域资源共享(CORS)在ASP.NET Web API中是如何实现的?
查看>>
MYSQL建表语法(主键,外键,联合主键)
查看>>
Docker容器的IO基准
查看>>
PostgreSQL 在铁老大订单系统中的schemaless设计和性能压测
查看>>
SaaS模式与ASP模式的差异分析报告
查看>>
[译]函数式响应编程入门指南
查看>>
解决tiny4412串口终端不能输入的问题
查看>>
FCN
查看>>
BloomFilter算法概述
查看>>
关于static 访问权限、继承、多态、内部类结合在一起时的使用方法
查看>>
HIMSS博览会首登中国 建言医卫IT新发展
查看>>
苹果将知名黑客Kristin Paget招致麾下
查看>>
【机器学习PAI实践七】文本分析算法实现新闻自动分类
查看>>
SACC 2013:大数据可视化应用及推荐
查看>>
这里有一份面筋请查收(七)
查看>>
在 Cocos2d-x 中使用 OpenSSL
查看>>
Python 进阶_OOP 面向对象编程_self 的实例绑定
查看>>
JAVA在win10上的安装环境配置
查看>>
闵春榕:PCIE SSD在数据库优化中的应用
查看>>