AHK Counter Gui 没有标题

AHK Counter Gui 没有标题

当我尝试在 AutoHotkey AHK 中制作一个小计数器来计算一些东西时,当我按下和Page down和时,一切都运行良好,但有一个小问题,它打开的 GUI 太小了,除非我使用键盘上的箭头,否则我无法移动它,并且 Windows 在重新打开它时不会记住它的最后位置。Up+minus

这是我目前所拥有的。周末我尝试了很多东西,但我似乎没有弄清楚如何让打开的窗口显示窗口标题或为其设置标题以便能够随意移动它

Gui, Add, Text, vCount w100, PgDn pressed 0 times.
Gui, Show,

Count := 0

$PgDn::   ;Default behavior is to block keystroke, ~ allows it to pass through
  Count := Count + 1
  GuiControl,,Count, PgDn pressed %Count% times.
  KeyWait, PgDn  ;Wait for PgDn to be released
return

$PgUp::   ;Default behavior is to block keystroke, ~ allows it to pass through
  Count := Count - 1
  GuiControl,,Count, PgUp pressed %Count% times.
  KeyWait, PgUp  ;Wait for PgUp to be released
return

GuiClose:
  ExitApp
return

任何帮助,将不胜感激。

答案1

终于做对了!

x := (A_ScreenWidth/2)-(Width/2)
y := (A_ScreenHeight/2)-(Height/2)
Gui, Show, %x% %y% w200 h50
Gui, Add, Text, vCount w150, PgDn pressed 0 times.
Count := 0

$PgDn::   ;Default behavior is to block keystroke, ~ allows it to pass through
  Count := Count + 1
  GuiControl,,Count, PgDn pressed %Count% times.
  KeyWait, PgDn  ;Wait for PgDn to be released
return

$PgUp::   ;Default behavior is to block keystroke, ~ allows it to pass through
  Count := Count - 1
  GuiControl,,Count, PgUp pressed %Count% times.
  KeyWait, PgUp  ;Wait for PgUp to be released
return

GuiClose:
  ExitApp
return

相关内容