Search found 14 matches

by User-AutoHotkey
01 Jun 2024, 12:57
Forum: Scripts and Functions (v1)
Topic: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit
Replies: 98
Views: 78508

Re: [LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit

Great tool that fixed long running issue with one of my scripts that was updated by external process that killed mine but didn't remove the tray icon. Users finished up with multiple icons in the system tray as it was updated each hour, and the icons only disappeared if moused-over or rebooted. The...
by User-AutoHotkey
01 Jun 2024, 12:51
Forum: 请求帮助
Topic: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved
Replies: 6
Views: 1042

Re: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved

sikongshan wrote:
01 Jun 2024, 02:03
看了你发的帖子,我的意思是:你修改上面我指出的两处以后,是可以完美清除图标的。你在测试一下
抱歉,我忘了测试后面的

Code: Select all

if(otray[A_index]["process"]=="")


你是对的😂
by User-AutoHotkey
01 Jun 2024, 12:50
Forum: Ask for Help (v2)
Topic: WinGetPID or WinGetProcessName cannot work, how to solve it? Topic is solved
Replies: 4
Views: 428

Re: WinGetPID or WinGetProcessName cannot work, how to solve it? Topic is solved

Thank you , I found A solution: #Warn All, Off OnError((*) => -1) TrayIcon_Clean() ; ported to AHK v2.0-beta by @krasnovpro ; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=1229 ; -----------------------------------------------------------------------------------------------------------------...
by User-AutoHotkey
31 May 2024, 00:01
Forum: Ask for Help (v2)
Topic: WinGetPID or WinGetProcessName cannot work, how to solve it? Topic is solved
Replies: 4
Views: 428

Re: WinGetPID or WinGetProcessName cannot work, how to solve it? Topic is solved

Hello, V2 does a better job of checking for errors and handling "errors" including this situation. In particular, if a window does not exist, v2 will typically not allow you to try to access it, aside from WinExist . You can contribute to this effort by checking whether the window exists. WinExist ...
by User-AutoHotkey
30 May 2024, 23:55
Forum: 请求帮助
Topic: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved
Replies: 6
Views: 1042

Re: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved

还没开始学习V2,对v2语法不熟悉,翻了下帮助。主要是v2莫名其妙针对窗口语句,加入了存在判断,这很不好玩,有这样的错误,整个脚本不运行了。 临时方案,可以在脚本开头加上两句。但是副作用也很明显,有错不报了。 #Warn All, Off OnError((*) => -1) 你发的那个v2翻译,因为还看不懂v2的数组写法,所以按照自己的理解,简单粗暴的修改了一下调用部分,你对照改一下 测试可以运行,有效果 TrayIcon_Clean(bVerbose := false) { otray:=TrayIcon_GetInfo("") for i, oIcon in otray { if(ot...
by User-AutoHotkey
30 May 2024, 19:08
Forum: Ask for Help (v2)
Topic: WinGetPID or WinGetProcessName cannot work, how to solve it? Topic is solved
Replies: 4
Views: 428

WinGetPID or WinGetProcessName cannot work, how to solve it? Topic is solved

TrayIcon_GetInfo(sExeName := "") { dhw := A_DetectHiddenWindows DetectHiddenWindows(1) oTrayInfo := [] for sTray in ["Shell_TrayWnd", "NotifyIconOverflowWindow"] { idxTB := TrayIcon_GetTrayBar(sTray) pidTaskbar := WinGetPID("ahk_class " sTray) hProc := DllCall("OpenProcess", "UInt",0x38, "Int",0, "...
by User-AutoHotkey
30 May 2024, 18:42
Forum: 请求帮助
Topic: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved
Replies: 6
Views: 1042

Re: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved

可以参考这个网页 https://www.autohotkey.com/boards/viewtopic.php?t=1229 感谢,V1脚本能解决,但我尝试用V2脚本,就报错: Error: Target window not found. Specifically: ahk_id 11800786 075: msgId := NumGet(nfo, A_Is64bitOS ? 12 : 8, "UPtr") 076: hIcon := NumGet(nfo, A_Is64bitOS ? 24 : 20, "Ptr") ▶ 078: nPid := WinGetPID("ahk_id " ...
by User-AutoHotkey
26 May 2024, 14:08
Forum: 请求帮助
Topic: ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved
Replies: 6
Views: 1042

ahk结束某程序后,某程序的托盘图标还在显示 Topic is solved

如题,ahk用

Code: Select all

ProcessCloseAll "keycastow.exe"
结束程序运行,但是这样会让右下角任务托盘中的程序还在运行

如果再一次调用该程序,又结束掉,托盘的同一个托盘图标又多出一个了

如图所示:
image.png
image.png (41.88 KiB) Viewed 1042 times
如果鼠标移到已结束任务的托盘图标位置,托盘图标就消失

AHK有什么办法能刷新托盘图标?
by User-AutoHotkey
20 May 2024, 13:38
Forum: Ask for Help (v2)
Topic: After pressing a shortcut key, start a commad, and then press the same shortcut key to run a script or exit process B. Topic is solved
Replies: 2
Views: 224

After pressing a shortcut key, start a commad, and then press the same shortcut key to run a script or exit process B. Topic is solved

^+PrintScreen:: { ProcessCloseAll "keycastow.exe" output := GetCMDOutput(SetDPIPath " get") ; 获取字符串中的DPI缩放倍率 DPI_ZOOM:=StrReplace(output,"Current Resolution: ","") DPI_ZOOM:=Integer(DPI_ZOOM) / 100 RunWait ShareXPath " -ScreenRecorderGIF" KeyWait "LButton", "D" KeyWait "LButton" MouseGetPos &mouseX...
by User-AutoHotkey
20 May 2024, 07:40
Forum: 请求帮助
Topic: 怎么做按键的变量,有偿请教大神求求了
Replies: 1
Views: 291

Re: 怎么做按键的变量,有偿请教大神求求了

你要按键的变量做什么?代码的工作目的是?

如果是按下时触发一些事件,可以这样写

Code: Select all

; 当按下按键,然后松开,才执行后面的代码
#Requires AutoHotkey v2.0
KeyWait "LButton", "D" ; 等待鼠标左键按下
KeyWait "LButton"  ; 等待鼠标左键被释放
; 下面是后续的工作
by User-AutoHotkey
20 May 2024, 07:35
Forum: Ask for Help (v2)
Topic: Unable to execute code that waits for one process to exit before exiting another process. Topic is solved
Replies: 2
Views: 239

Unable to execute code that waits for one process to exit before exiting another process. Topic is solved

image.png If I run the ShareX program (an open-source screenshot software on Github), a process called "ffmpeg.exe" will appear in the task manager. I want to end another program called "keycastow.exe" when it detects that "ffmpeg.exe" has been terminated. However, in practice, it does not wait for...
by User-AutoHotkey
20 May 2024, 06:42
Forum: 脚本函数
Topic: AHK获取CMD命令结果三种方法【RunAnyCtrl】
Replies: 5
Views: 9944

Re: AHK获取CMD命令结果三种方法【RunAnyCtrl】

在V2版本中,可以这样: GetCMDOutput(command){ Shell := ComObject("WScript.Shell") exec := Shell.Exec(A_ComSpec " /C " command) return exec.StdOut.ReadAll() } output := GetCMDOutput("echo %Date%") MsgBox output 若要避免使用临时文件(尤其是在输出较大的情况下),请考虑使用 Shell.Exec() 方法,如 Run 命令的示例中所示。 或 ; 下面的2个调用:cmd窗口将在第一次运行时快速闪烁一次 ; 这是为...

Go to advanced search