Jump to content
Sign in to follow this  

resize gui using winmove

Recommended Posts



I've been using winmove to resize a gui when a button is pressed and noticed a slight delay when it trys to redraw all the controls.


GuiCreate ("MyGUI")

$nOk    = GUISetControl ("button", "OK", 20,70)


While GuiMsg() > 0
    if $nOK= GuiRead () then
  $position = WinGetPos("MyGUI")
  WinMove("MyGUI", "", $position[0], $position[1], $position[2], $position[3]+ 2)

Is this the correct way to resize a gui?

Share this post

Link to post
Share on other sites

1) You want to set Opt("WinWaitDelay", 10)

Alters how long a script should briefly pause after a successful window-related operation. Default is 250 milliseconds

2) You can give the GUI a WS_THICKFRAME style which allows the user to resize the window with the mouse.

Here's an example showing both:

$WS_THICKFRAME = 0x40000;resizability
$title = "Example Resizable GUI"

Opt("GUIResizeMode", 0); no control resizing.... see also GuiSetControlEx
Opt("WinWaitDelay", 10)

GuiCreate($title, 300, 300, 100, 100, $WS_THICKFRAME)
$button = GuiSetControl("button", "button", 10, 100, 100, 100)

While 1
   $msg = GuiMsg(0)
   If $msg = -3 Then
   ElseIf $msg = $button Then
      $pos = WinGetPos($title)
      WinMove($title,"", $pos[0], $pos[1], $pos[2]+10, $pos[3]+10)
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.