我需要保持窗口处于活动状态

Jan*_*Doh 5 firefox google-chrome autohotkey windows-10

我需要在使用另一个窗口时保持浏览器窗口处于活动状态。

“Keep-on-Top”不是我之前看到的,因为当我切换页面时,它仍然处于非活动状态。

我试图阻止页面识别出我正在离开窗口(识别前大约 10 秒的窗口)。

我偶然发现了一个 AutoHotKey,但我不够聪明,无法使用它:

SetTimer, constantActivation, 10
return
constantActivation:
WinWaitNotActive, your_window
WinActivate, your_window
return
Run Code Online (Sandbox Code Playgroud)

有什么建议或技巧吗?现在,我将鼠标设置为只需将鼠标悬停在页面上即可激活页面,但如果我必须每 9 秒将鼠标悬停在窗口上,这并不能真正解决问题。

例如,我想在右侧浏览 Firefox,同时在左侧保持 Chrome 处于活动状态:
在此输入图像描述

小智 0

未经测试,但你可以尝试一下......

; Keeping window active while a script is running.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent ; Keeps a script permanently running until the user closes it or ExitApp is encountered.
#SingleInstance, Force ; Determines whether a script is allowed to run again when it is already running.
DetectHiddenWindows, On ; Determines whether invisible windows are "seen" by the script.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode, 2 ; Sets the matching behavior of the WinTitle parameter in commands.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

SetTimer, WinExist_YOUR-WINDOW, 100
WinExist_YOUR-WINDOW:
If WinExist("YOUR-WINDOW ahk_class AutoHotkey")
    WinActivate, ahk_exe YOUR-WINDOW.EXE
Return
Run Code Online (Sandbox Code Playgroud)