我想要“运行ahk_class SunAwtDialog”窗口stayAlwaysOnTop。这次它不起作用。它与其他窗口一起工作,例如谷歌铬。这是代码:
CoordMode,Pixel
CoordMode,Screen
CoordMode,Mouse
run_Win = Run ahk_class SunAwtDialog
SetTitleMatchMode,1
IfWinNotExist,%run_Win%
{
MsgBox,:( Oops
Reload
}
SetTitleMatchMode,2
WinSet , AlwaysOnTop , Off , SciTE4AutoHotkey
SetTitleMatchMode,1
WinSet , AlwaysOnTop , On , %run_Win% ; dont work. window stays behind
WinGetPos,x,y,w,h,%run_Win%
MouseGetPos,xM,yM
MouseMove,% x, % y , 10 ; works: mouse is moving to left top of the window
Sleep,500
MouseMove,% xM, % yM , 10 ; works: restore mouse pos
MsgBox, , endOfProgramm1, endOfProgramm2 , 1
答案 0 :(得分:0)
您的代码段
run_Win = Run ahk_class SunAwtDialog
SetTitleMatchMode,1
IfWinNotExist,%run_Win%
可以翻译为
SetTitleMatchMode,1
IfWinNotExist,Run ahk_class SunAwtDialog
。 IfWinNotExist, Run ahk_class ...
没有任何意义。移除run
变量内容中的run_Win
。
(有关如何抓住正确窗口的信息,请参阅WinTitle)