class QdirManager {
ppid := -1
ppath := ""
__New(pathIn) {
this.ppath := pathIn
}
__Delete() {
}
init() {
Run(this.ppath, , , &ppidTmp)
this.ppid := ppidTmp
; waiting window initialization
Loop 20 {
Sleep(50)
if (WinExist("ahk_pid " this.ppid) > 0) {
break
}
}
WinActivate("ahk_pid " this.ppid)
}
bringFront() {
; ; MsgBox(WinExist("ahk_pid " this.ppid))
; if (WinExist("ahk_pid " this.ppid)) {
; WinActivate("ahk_pid " this.ppid)
; }
oList := WinGetList("ahk_exe" this.ppath, , ,) ; ahk_id
if (oList.Length >= 1) {
this.ppid := WinGetPID("ahk_id " oList[1])
WinActivate("ahk_pid " this.ppid)
}
else {
this.init()
} ; flash across
myGui := Gui("+AlwaysOnTop -Caption +LastFound -SysMenu +ToolWindow -DPIScale +E0x20", "myGui")
WinSetTransparent(100, myGui)
myGui.BackColor := "EEAA99"
myGui.Show("x0 y0 w" . A_ScreenWidth - 300 . " h" . A_ScreenHeight - 300)
Sleep(100)
myGui.Destroy()
}
} global glb_qdirManager1 := QdirManager("D:\tool\Q-Dir-AA\Q-Dir_x64.exe")
global glb_qdirManager2 := QdirManager("D:\tool\Q-Dir-AB\Q-Dir_x64.exe")
global glb_qdirManager3 := QdirManager("C:\Program Files (x86)\UltraExplorer\UltraExplorer.exe")
#q:: {
glb_qdirManager1.bringFront()
}
#w:: {
glb_qdirManager2.bringFront()
}
#e:: {
glb_qdirManager3.bringFront()
} win_No(pp) {
; pp := "D:\Program Files\Notepad++\notepad++.exe"
winlist := WinGetList("ahk_exe " . pp)
if (winlist.Length = 0) {
Run(pp, , , &ppidTmp)
; waiting window initialization
Loop 20 {
Sleep(50)
if (WinExist("ahk_pid " ppidTmp) > 0) {
break
}
}
WinActivate("ahk_pid " ppidTmp)
}
else {
WinActivate("ahk_exe " . pp)
} ; flash across
myGui := Gui("+AlwaysOnTop -Caption +LastFound -SysMenu +ToolWindow -DPIScale +E0x20", "myGui")
WinSetTransparent(100, myGui)
myGui.BackColor := "EEAA99"
myGui.Show("x0 y0 w" . A_ScreenWidth - 300 . " h" . A_ScreenHeight - 300)
Sleep(100)
myGui.Destroy()
}
#1:: win_No("C:\Program Files\Google\Chrome\Application\chrome.exe")
#2:: win_No("D:\Programs\Microsoft VS Code\Code.exe")
#3:: win_No("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe") ; F4:: ExitApp 3333

in q-dir, press F3 to search with everything

F3:: {
if (WinActive("ahk_exe Q-Dir_x64.exe")) {
Send("{CtrlDown}{ShiftDown}c{ShiftUp}{CtrlUp}")
ss := Trim(A_Clipboard, "`\")
cmd := "D:\Program` Files\Everything\Everything.exe -path " . ss
Run(cmd) ; MsgBox(cmd)
}
else {
Send("F3")
}
return
}

autohotkey switching within applications的更多相关文章

  1. Facebook技术架构

    Facebook MySQL,Multifeed (a custom distributed system which takes the tens of thousands of updates f ...

  2. Application.HookMainWindow完全替代了原来的窗口过程(但是好像也会继续传递)

    unit HookMain; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialo ...

  3. 点击Winform右下角图标,在最前端展示窗口

    //调用Windows API 展示窗口到最前端 SwitchToThisWindow(this.Handle, true);//窗体的句柄 this.Handle     SwitchToThisW ...

  4. QFileDialog::getOpenFileName() hangs

    https://forum.qt.io/topic/49209/qfiledialog-getopenfilename-hangs-in-windows-when-using-the-native-d ...

  5. Oracle Applications Multiple Organizations Access Control for Custom Code

    档 ID 420787.1 White Paper Oracle Applications Multiple Organizations Access Control for Custom Code ...

  6. How use Instruments and display the console in Command Lines applications

    I'm using Xcode on OSX to develop command line C applications. I would also like to use Instruments ...

  7. Stateful Kubernetes Applications Made Easier: PSO and FlashBlade

    转自:https://medium.com/@joshua_robinson/stateful-kubernetes-applications-made-easier-pso-and-flashbla ...

  8. Digital Adjustment of DC-DC Converter Output Voltage in Portable Applications

    http://pdfserv.maximintegrated.com/en/an/AN818.pdf http://www.maximintegrated.com/app-notes/index.mv ...

  9. Changing the Output Voltage of a Switching Regulator on the Fly

    http://www.powerguru.org/changing-the-output-voltage-of-a-switching-regulator-on-the-fly/ There are ...

  10. 13 Stream Processing Patterns for building Streaming and Realtime Applications

    原文:https://iwringer.wordpress.com/2015/08/03/patterns-for-streaming-realtime-analytics/ Introduction ...

随机推荐

  1. CF837G - Functions On The Segments

    我们考虑 \(\sum_{i=l}^r{f_i(x)}\) 是个什么东西.首先这个奇怪的东西很好离线做,所以尽管题目要求强制在线,我们还是离线下来试试. 我们发现,我们可以 \(x\) 坐标从 \(1 ...

  2. Android:DrawerLayout 抽屉布局没有反应

    <androidx.drawerlayout.widget.DrawerLayout android:id="@+id/drawer_layout" android:layo ...

  3. 空间数据库中ST_开头的来由

    1. 引言 在使用空间数据库(如,PostGIS)时,我们经常使用的空间函数(如,ST_Distance(geometry, geometry).ST_Area(geometry)等)都是以ST_开头 ...

  4. SAP NOTE 489676 VF188异常

    解决方案 VOFM->复制请求->出具发票单据(B) 新建999例程

  5. 【C学习笔记】day5-2 写代码可以在整型有序数组中查找想要的数字, 找到了返回下标,找不到返回-1.(折半查找)

    #include <stdio.h> #include <stdlib.h> int find(int s) { int n = 0; scanf_s("%d&quo ...

  6. C++ MFC字符转换

    创建Win32 空项目 字符说明:国外 1个字符对应1个字节   多字节 中文  1个字符对应对个字节  宽字节   Unicode  utf-8  3个   GBK  2个 多字节转为 宽字节    ...

  7. golang 中mgo update报错: The dollar ($) prefixed field '$inc' in '$inc' is not valid for storage.

    _, err := c.Find(bson.M{"index": index}).Apply(mgo.Change{ Upsert: true, ReturnNew: false, ...

  8. pytest框架增加log打印(包括pytest的执行结果、自定义的log信息)

    前言: 之前同事在跑脚本的时候报错了,发现没法把需要的log信息打印出来,我这边定位问题比较麻烦,所以增加了log的打印.这个问题之前已经处理过了,本来以为是小问题,结果今天又要用到这个小技巧的时候居 ...

  9. Java面向对象之什么是多态?

    多态 动态编译:类型:可扩展性 即同一方法可以根据发送对象的不同而采用多种不同的行为方式. 一个对象的实际类型是确定的,但可以指向对象的引用的类型有很多. 多态存在的条件: 1.有继承关系,类型转换异 ...

  10. 基于Spring AOP切面实现请求入参出参加解密

    1.Mavne导入加密解密所需的依赖 <dependency> <groupId>org.apache.commons</groupId> <artifact ...