;
;
; 开机时自动启动的AutoHotkey脚本
;
; 此脚本修改时间 2019年06月18日20时48分
;
; 计时器创建代码段 -----------------------------------------------------------------------------------------
; SetTimer可以模拟多线程从而不影响主线程的流畅执行
; 请在SciTE4AutoHotkey中选中单词并按快捷键F12跳转到函数定义处
; 绿色免安装程序,统一都分类保存在本地磁盘D分区文件夹 D:\Program 中
; 例如: MasterSeeker就长期坚持固定不变保存位置在 D:\Program\MasterSeeker\MasterSeeker.exe
; 例如: FileLocator Pro就长期坚持固定不变保存位置在 D:\Program\FileLocator\FileLocator.exe
; #####################################################################
;
global ProgramDir
ProgramDir=%A_ScriptDir%\..
SetTimer,01设置全局无窗口快捷键,-1000
; 请养成按<Win> + F 隐藏MasterSeeker窗口的习惯
SetTimer,12保持MasterSeeker窗口常驻内存,9000
SetTimer,13设置此脚本的运行参数,-1000
SetTimer,14设置此脚本用户自定义变量,-1000
SetTimer,15防止重复运行此脚本,-1000
SetTimer,16运行国税金税盘开票软件,-100
SetTimer,17运行一些软件应用程序,-1000
SetTimer,18关广告窗口删除广告文件,3000
; 设置插入当前日期和时间的热字串WT ( What is the time now )
::wt::
NowTimeString=%A_YYYY%年%A_MM%月%A_DD%日%A_Hour%时%A_Min%分
Clipboard=%NowTimeString%
Send ^v
return
return
;
; 此脚本相关信息说明段 ---------------------------------------------------------------------------------------
; 用法 把此AHK脚本文件复制到 “shell:startup”文件夹中
; shell:startup”文件夹一般位于开始菜单->所有程序->启动 文件夹
; 作者 徐晓亮 vlanweiyun618
; 电子邮箱地址 595076941@QQ.com
; 手机号码
;
; 函数子程序定义段 --------------------------------------------------------------------------------------------
;
01设置全局无窗口快捷键()
{
Hotkey,`#n,02激活或隐藏窗口EmEditor
Hotkey,`#e,03激活或隐藏窗口TotalCommander ; 按热键 Win+E 激活 TotalCommander
Hotkey,`#f,04激活或隐藏窗口MasterSeeker
Hotkey,`#g,05激活或隐藏窗口Everything
Hotkey,`#s,06激活或隐藏窗口SogouExplorer
Hotkey,`#c,07激活或隐藏窗口计算器Calc ; 按热键 Win + C,打开计算器
Hotkey,`^!E,08用SciTE4AutoHotkey编辑此脚本
Hotkey,`^!R,09重启此脚本
Hotkey,^!F10,10终止此脚本执行 ;按Ctrl+Alt+F10键此脚本立即停止执行并退出
}
;
02激活或隐藏窗口EmEditor()
{
根据窗口类名激活或者隐藏窗口()
}
;
03激活或隐藏窗口TotalCommander()
{
根据窗口类名激活或者隐藏窗口("TotalCMD","TTOTAL_CMD")
}
;
04激活或隐藏窗口MasterSeeker()
{
根据窗口类名激活或者隐藏窗口("MasterSeeker","WindowsForms10.Window.8.app.0.218f99c")
;----- 全选激活MasterSeeker窗口的搜索编辑框:
loop,3
{
ControlFocus,Filename,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,10
ControlSend,Filename,{End},ahk_class WindowsForms10.Window.8.app.0.218f99c
}
Sleep,10
ControlSend,Filename,{ShiftDown}{Home}{ShiftUp},ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,10
}
;
05激活或隐藏窗口Everything()
{
; 当窗口标题测试不通过的话只好用窗口类了
Process,Close,Everything.exe
根据窗口类名激活或者隐藏窗口("Everything","EVERYTHING")
}
;
06激活或隐藏窗口SogouExplorer()
{
根据窗口类名激活或者隐藏窗口("SogouExplorer","SE_SogouExplorerFrame")
}
;
07激活或隐藏窗口计算器Calc()
{
Run,calc
}
;
08用SciTE4AutoHotkey编辑此脚本()
{
IfExist,%ProgramDir%\AutoHotkey\SciTE\SciTE.exe
Run,%ProgramDir%\AutoHotkey\SciTE\SciTE.exe %A_ScriptName%
else
{
ToolTip,找不到文件%ProgramDir%\AutoHotkey\SciTE\SciTE.exe ,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
SetTimer, RemoveToolTip, 5000
Sleep,3000
}
}
;
09重启此脚本()
{
Reload
}
;
10终止此脚本执行()
{
ToolTip,%A_ScriptName% (即此脚本)已经退出
SetTimer, RemoveToolTip, 500
Sleep,500
ExitApp
}
;
12保持MasterSeeker窗口常驻内存()
{
Process,Exist,MasterSeeker.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,MasterSeeker 1.5.1 by DxCK
{
IfWinNotExist,ahk_exe MasterSeeker.exe
{
IfExist,%ProgramDir%\MasterSeeker\MasterSeeker.exe
Run,%ProgramDir%\MasterSeeker\MasterSeeker.exe
WinWait,ahk_class WindowsForms10.Window.8.app.0.218f99c
loop,3
{
WinHide,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,100
}
}
}
}
}
;
13设置此脚本的运行参数()
{
#SingleInstance,force ;当此脚本已经运行时自动替换旧实例再次运行。
#Persistent ;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#NoEnv ;不检查空变量是否为环境变量(建议所有新脚本使用)。
#WinActivateForce ;用强制的方法激活窗口。阻止任务栏按钮的闪烁.
;~ #NoTrayIcon ;不显示托盘图标。
;~ #Warn
SetWorkingDir,%A_ScriptDir% ;改变脚本的当前工作目录。
DetectHiddenWindows,On ;设置脚本可以“看见”隐藏的窗口。
SetTitleMatchMode,2 ;窗口标题匹配模式改成某个位置必须包含WinTitle。
SendMode,Input ;SendInput 通常更快更可靠. 缓存了发送期间任何物理的键盘或鼠标活动, 避免了在发送时夹杂用户的键击.
CoordMode,Mouse,Screen
CoordMode,Pixel,Screen
CoordMode,ToolTip,Screen
ListLines,Off
SetBatchLines,-1
SetStoreCapsLockMode, On

;~ SetBatchLines,
;~ SetKeyDelay,
;~ SetWinDelay,
;~ SetControlDelay,
}
;
14设置此脚本用户自定义变量()
{
;~ global 移动硬盘盘符 ;带冒号:
}
;
15防止重复运行此脚本()
{
#SingleInstance,force
loop,33
{
DetectHiddenWindows,On
Sleep,33
IfWinExist,QQ595076941_AutoRunAHK
ExitApp
}
Gui, Show, Hide,QQ595076941_AutoRunAHK
}
;
16运行国税金税盘开票软件()
{
IfExist,D:\Progra~1\开票软件\MainExecute.exe
{
Run,D:\Progra~1\开票软件\MainExecute.exe
loop,333
{
WinGet, WinID, ID,LoginForm
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinGetActiveTitle,WinActiveTitlekp
Sleep,500
IfInString,WinActiveTitlekp,LoginForm
{
ControlClick,登录,LoginForm
}
Sleep,500
IfWinActive,,上报汇总已成功
{
ControlClick,确认,,上报汇总已成功
}
;~ 如果成功登录国税开票软件,那么立即退出本次LOOP循环
IfInString,WinActiveTitlekp,增值税发票税控开票软件
{
break
}
;~ 证书口令不能为空,退出循环,手工登录
IfWinExist,,证书口令不能为空
{
break
}
}
Sleep,100
;~ Run,%comspec% /c C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation
Sleep,2000
WinClose,USB KEY PIN,请输入KEY的PIN码
}
}
;
17运行一些软件应用程序()
{
IfExistRun("WiseDesktop") ;虚拟桌面
;~ IfExistRun("Rolan")
;~ IfExistRun("PCOff") ;定时强制关机精灵1.0 在 17:05 下班后定时强制关闭电脑
}
;
18关广告窗口删除广告文件()
{
; 请用 AHKInfo 1.3.5 窗口信息查询工具来获取窗口标题和窗口类名
;等待指定标题窗口出现
WinClose, FF新推荐
;~ 广告弹窗专杀语句格式 WinClose,ahk_exe SohuNews.exe
;~ ;; ;; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
;~ WinClose,ahk_class XLUEFrameHostWnd,
;~ WinHide, 迅雷 ahk_class Chrome_WidgetWin_0, Chrome Leg
winhide,ahk_class XLUEFrameHostWnd
;~ WinClose,USB KEY PIN,请输入KEY的PIN码
;~ WinClose,ahk_exe QQPCSoftTrayTips.exe
;~ WinClose,ahk_exe QQPCTray.exe
;~ WinClose,ahk_exe SohuNews.exe
;~ WinClose,ahk_exe SGTool.exe
;~ WinClose,ahk_exe PicFaceTool.exe
;~ WinClose,ahk_exe wpscEnter.exe
;~ WinClose,ahk_exe WindowsForms10.Window.20008.app.0.261f82a_r13_ad1
;~ WinClose,ahk_exe AutoShow.exe
;~ WinClose,ahk_exe skinbox.exe
;~ WinClose,ahk_exe WnComMgr.exe
;~ WinClose,ahk_exe WnMoniter.exe
;~ WinClose,ahk_exe WnHelper64.exe
;~ WinClose,ahk_exe WnUserPage.exe
;~ WinClose,ahk_class TXGuiFoundation
;~ WinClose,头条新闻
;~ WinClose,到期抄报税提示
;~ WinClose,USB KEY PIN,请输入KEY的PIN码
;等待指定标题窗口出现
;~ WinClose,FF新推荐 ahk_class #32770,
}
;
; 请使用 窗口信息工具 AHKInfo 1.3.5 获取窗口的类名
根据窗口类名激活或者隐藏窗口(VarExeFileName:="EmEditor",VarWinClassName:="EmEditorMainFrame3")
{
; 1、如果程序没有运行则运行程序
Process,Exist,%VarExeFileName%.exe
if (%ErrorLevel%=0)
{
IfExist,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
{
Run,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
return
}
else
{
MsgBox,找不到文件 %ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
return
}
}
; 2、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_class %VarWinClassName%
{
loop,3
{
WinShow,ahk_class %VarWinClassName%
WinMaximize,ahk_class %VarWinClassName%
WinGet, WinID, ID,ahk_class %VarWinClassName%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
return
}
; 3、如果窗口已经显示并置顶则隐藏窗口
;~ WinMinimize,ahk_class %VarWinClassName%
WinHide,ahk_class %VarWinClassName%
}
IfExistRun(TargetEXE) ;检查文件是否存在并运行程序
{
IfExist,%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
Run,%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
else
{
ToolTip,未找到文件%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
SetTimer, RemoveToolTip, 5000
}
}
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
;
; #####################################################################
;
; 此脚本到此行结束

开机时自动启动的AutoHotkey脚本 2019年07月08日19时06分的更多相关文章

  1. 开机时自动启动的AutoHotkey脚本 2019年10月09日

    ;;; 开机时自动启动的AutoHotkey脚本 2019年10月09日;; http://www.autoahk.com/archives/16600; https://www.cnblogs.co ...

  2. 键盘和鼠标闲置超时时关闭显示器并锁定电脑桌面的AutoHotkey脚本 2019年11月24日写

    /* 键盘和鼠标闲置超时时关闭显示器并锁定电脑桌面的AutoHotkey脚本 2019年11月24日写 在电脑桌面锁定时移动鼠标就会显示登录界面,此时即使超过电源设置的时间电脑也不会关闭显示器使得屏幕 ...

  3. 【2019年07月08日】A股最便宜的股票

    查看更多A股最便宜的股票:androidinvest.com/CNValueTop/ 便宜指数 = PE + PB + 股息 + ROE,四因子等权,数值越大代表越低估. 本策略只是根据最新的数据来选 ...

  4. 开机时自动启动的AutoHotkey脚本

    ;;; 开机时自动启动的AutoHotkey脚本;; 此脚本修改时间 2019年06月18日20时48分;; 计时器创建代码段 ------------------------------------ ...

  5. 'Rem EverythingAutoSetup.VBS 安装Everything的VBS脚本 2019年11月25日写

    'Rem EverythingAutoSetup.VBS 安装Everything的VBS脚本 2019年11月25日写 'Rem Everything是voidtools开发的一款本地NTFS文件和 ...

  6. sql 计算两时间或日期 的相差的 年、 月、 日、时、分、秒,年、月、日分别的提取

    --年.月.日.时.分.秒 datediff(yy,date1,date2) datediff(m,date1,date2) datediff(d,date1,date2) datediff(hh,d ...

  7. 【2019年07月22日】A股最便宜的股票

    查看更多A股最便宜的股票:androidinvest.com/CNValueTop/ 便宜指数 = PE + PB + 股息 + ROE,四因子等权,数值越大代表越低估. 本策略只是根据最新的数据来选 ...

  8. AHKManager.ahk AHK管理器 2019年12月15日

    AHKManager.ahk  AHK管理器  2019年12月15日 快捷键   {Alt} + {F1} ///////////////////////////////////////////// ...

  9. ;~ 小部分AutoHotkey源代码片段测试模板2019年10月9日.ahk

    ;~ 小部分AutoHotkey源代码片段测试模板2019年10月9日.ahk ;~ 此脚本用于测试执行一行或多行AHK脚本源代码的效果;~ 此脚本最后修改于2019年9月22日20时03分;~ 把此 ...

随机推荐

  1. excel VBA构造正则函数(单参数)

    Function zhengze(Rng As Range)    Set regx = CreateObject("vbscript.regexp")With regx  .Gl ...

  2. Binding(四):数据校验

    ​    除了上一节讲的类型转换器,Binding还自带数据校验功能,这节主要来讲一下. 跟类型转换器一样,数据校验需要我们继承ValidationRule类,实现其中的Validate方法,并写入我 ...

  3. POJ 1050 To the Max 枚举+dp

    大致题意: 求最大子矩阵和 分析: 一开始想复杂了,推出了一个状态方程:d[i][j]=max(d[i][j-1]+-,d[i-1][j]+-).写着写着发现上式省略的部分记录起来很麻烦. 后来发现n ...

  4. Burning Bridges 求tarjan求割边

    Burning Bridges 给出含有n个顶点和m条边的连通无向图,求出所有割边的序号. 1 #include <cstdio> 2 #include <cstring> 3 ...

  5. python log装饰器

    def log(func): #将原函数对象的指定属性复制给包装函数对象, 默认有 module.name.doc,或者通过参数选择 @functools.wraps(func) def wrappe ...

  6. JAVA基础之JDK、JRE、JVM关系

    什么是JRE和JDK JDK(Java Development Kit Java开发工具包) JDK是提供给Java开发人员使用的,其中包含了java的开发工具,也包括了JRE.所以安装了JDK,就不 ...

  7. python爬取北京政府信件信息01

    python爬取,找到目标地址,开始研究网页代码格式,于是就开始根据之前学的知识进行爬取,出师不利啊,一开始爬取就出现了个问题,这是之前是没有遇到过的,明明地址没问题,就是显示网页不存在,于是就在百度 ...

  8. 11. Linux从入门到进阶

    课程大纲 • Linux简介 • Linux基础 • Linux常用命令 • Shell编程&awk

  9. SpringBoot获取前端传递JSON的几种方法

    一.Json对象+@RequestBody接收 var val = {id: 1, name: "小明"}; $.ajax({ url: "/getJson", ...

  10. SpringBoot整合Shiro实现权限控制

    目录 1.SpringBoot整合Shiro 1.1.shiro简介 1.2.代码的具体实现 1.2.1.Maven的配置 1.2.2.整合需要实现的类 1.2.3.项目结构 1.2.4.ShiroC ...