繁体   English   中英

AutoHotkey 变量不作为坐标发送

[英]AutoHotkey Variables Not Sending as Coordinates

我无法让 Synatx 正常工作,无法让 GUI 在正确的位置显示窗口。 它应该显示在 x0、y(SciteWindow 的坐标)、w(显示器宽度)、h(显示器高度/17)处。 我认为我的 Winmove 命令中存在错误。 请参阅随附的代码。

#SingleInstance,Force
WinGetPos , X_SciTEWindow, Y_SciTEWindow, Width_SciTEWindow, Height_SciTEWindow, ahk_class SciTEWindow ;I don't even need the X_SciTEWindow, because the bars will all be aligned at x0, but it's there... 
SysGet, aScreenHeight, 1 
bar_height := Round(aScreenHeight / 17)
Gui, Color, aqua,FFB1B1
Gui, Show, w%A_ScreenWidth% h%bar_height%, SomeStupidBar
WinSet, Style,  -20xC40000
Winmove, %SomeStupidBar%,  x0, y%Y_SciTEWindow%, w%A_ScreenWidth%, h%bar_height%
MsgBox, Time to move the window to x0, y%Y_SciTEWindow%, w%A_ScreenWidth%, h%bar_height%
Winmove, %SomeStupidBar%,  x0, y%Y_SciTEWindow%, w%A_ScreenWidth%, h%bar_height%
return
Esc::ExitApp


SetTimer, ShowGui, 500
ShowGui:    
IfWinNotExist, ahk_class AutohotkeyGUI
{
Gui, +Owner%WinID% +Border +ToolWindow 
Gui, Show, NoActivate x%X% y%Y% w51 h431, %GuiTitle%
}
else
{
WinWaitActive, ahk_class SciTEWindow
WinGetPos, X_SciTEWindow, Y_SciTEWindow,,, ahk_class Notepad
WinGet, WinID, ID, ahk_class SciTEWindow,,,
IfWinNotExist, ahk_class AutohotkeyGUI
WinGetPos, %SomeStupidBar%, , , ,  ahk_class AutohotkeyGUI
If %SomeStupidBar%<>X - 56
WinMove, ahk_class AutohotkeyGUI,  X - 56
}
return

该文档指出,您需要具备以下条件之一:

WinMove, WinTitle, WinText, X, Y [, Width, Height, ExcludeTitle, ExcludeText]
WinMove, X, Y

你有:

Winmove, %SomeStupidBar%,  x0, y%Y_SciTEWindow%, w%A_ScreenWidth%, h%bar_height%

请注意缺少的 WinText。

尝试将其留空:

Winmove, %SomeStupidBar%,, x0, y%Y_SciTEWindow%, w%A_ScreenWidth%, h%bar_height%

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM