我一直在使用 Alwaysontop AHK 腳本來保持我的視窗在其他視窗之上。
這是有問題的代碼:
^SPACE:: Winset, Alwaysontop, , A ; ctrl space
Return
~#!x::Suspend
它幾乎適用于我使用的每個視窗,除了基于 Windows 的視窗 - 諸如檔案資源管理器、任務管理器等......
我怎樣才能讓這些視窗也與腳本一起作業?
我以前使用 WinSpy 來獲取有關特定 Windows 事物的資訊,但我不確定要在這里查找什么,或者是否有更簡單的解決方案可以強制基于 Windows 的視窗與腳本一起運行。
有任何想法嗎?
uj5u.com熱心網友回復:
AHK 不會攔截以提升權限運行的程式中的按鍵操作,除非腳本本身以這種方式運行:
#UseHook
; If the script is not elevated, relaunch as administrator and kill current instance:
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try ; leads to having the script re-launching itself as administrator
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
RETURN ; === end of auto-execute section ===
; ctrl space:
^SPACE:: Winset, Alwaysontop, , A
~#!x::Suspend
有關更多詳細資訊,請閱讀https://autohotkey.com/docs/commands/Run.htm#RunAs。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/388373.html
下一篇:nasm中的嵌套回圈
