Page 1 of 1

Change the size of window

Posted: 28 Oct 2017, 22:31
by xuezhe

Code: Select all


#SingleInstance force
global Gui
Gui:=GuiCreate("+AlwaysOnTop","Window")
Gui.SetFont(,"微软雅黑")
Gui.Add("Edit","x0 y0 w200 h100")

Gui.OnEvent("Size", "Change") ;用户调整窗口大小
Gui.Show("AutoSize")

Change(Gui,MinMax,Width,Height)
{
MsgBox MinMax "`n" Width "`n" Height
}

it doesn't work well in AHK_H V2.

Re: Change the size of window

Posted: 29 Oct 2017, 02:28
by HotKeyIt
It seems to work fine for me, what is the problem?

Re: Change the size of window

Posted: 29 Oct 2017, 08:13
by xuezhe
HotKeyIt wrote:It seems to work fine for me, what is the problem?
When the user change the size of the window ,the fuction of change should work.but I run the ahk,It shows the width and height at once.

I wanna find the event when changing the window size.

Re: Change the size of window

Posted: 29 Oct 2017, 09:31
by HotKeyIt
This is because your window is +AlwaysOnTop and message box pops up behind the window!

Re: Change the size of window

Posted: 30 Oct 2017, 09:41
by xuezhe
I don't understand the usage of changing the size of the window, could you give an example .
Running the above code, I can't change the size of the window.

Re: Change the size of window

Posted: 30 Oct 2017, 15:57
by HotKeyIt
You need to add +Resize;

Code: Select all

#SingleInstance force
global Gui
Gui:=GuiCreate("+AlwaysOnTop +ReSize","Window")
Gui.SetFont(,"微软雅黑")
Gui.Add("Edit","x0 y0 w200 h100")

Gui.OnEvent("Size", "Change") ;用户调整窗口大小
Gui.Show("AutoSize")

Change(Gui,MinMax,Width,Height)
{
ToolTip MinMax "`n" Width "`n" Height
}

Re: Change the size of window

Posted: 30 Oct 2017, 23:44
by xuezhe
thx.