Change the size of window

Ask for help, how to use AHK_H, etc.
xuezhe
Posts: 87
Joined: 06 Jan 2016, 11:02

Change the size of window

28 Oct 2017, 22:31

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.
HotKeyIt
Posts: 1712
Joined: 29 Sep 2013, 18:35
Contact:

Re: Change the size of window

29 Oct 2017, 02:28

It seems to work fine for me, what is the problem?
xuezhe
Posts: 87
Joined: 06 Jan 2016, 11:02

Re: Change the size of window

29 Oct 2017, 08:13

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.
HotKeyIt
Posts: 1712
Joined: 29 Sep 2013, 18:35
Contact:

Re: Change the size of window

29 Oct 2017, 09:31

This is because your window is +AlwaysOnTop and message box pops up behind the window!
xuezhe
Posts: 87
Joined: 06 Jan 2016, 11:02

Re: Change the size of window

30 Oct 2017, 09:41

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.
HotKeyIt
Posts: 1712
Joined: 29 Sep 2013, 18:35
Contact:

Re: Change the size of window

30 Oct 2017, 15:57

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
}

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 5 guests