Jump to content
Sign in to follow this  

How do I...get GUI window position

Recommended Posts


I have a GUI window that by defualt (per the code samples) displays in the middle of the screen each time.

I'd like to give the user the ability to move the dialog so that subsequent calls of the dialog will position it in the last position (the position it was in when the GUI was closed).

What do I need to call in order to get the TOP and LEFT position of a GUI window?


Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'


Share this post

Link to post
Share on other sites

just a note... to place the GUI in the middle of the screen

; Center Window on Screen
; Author cdkid and Valuater

Func _Middle($win, $txt)
    $size = WinGetClientSize($win, $txt)
    Local $y = (@DesktopHeight / 2) - ($size[1] / 2)
    Local $x = (@DesktopWidth / 2) - ($size[0] / 2)
    Return WinMove($win, $txt, $x, $y)
EndFunc ;==>_Middle



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.