JScript Posted June 2, 2014 Share Posted June 2, 2014 (edited) Hello guys ...I noticed that a window created with AutoIt, the coordinates of width and height are relative to the client area rather than to the window itself!Well, after some tests I got this simple code that causes the width and height are for the window and not to the client area.I hope it's useful for someone else ...Code:Func _GUICreateEx($Title, $iWidth = 400, $iHeight = 400, $iLeft = -1, $iTop = -1, $iStyle = -1, $iexStyle = -1, $hParent = 0) If $iWidth > @DesktopWidth Then $iFrameY = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 33) $iFrameY = $iFrameY[0] $iWidth = @DesktopWidth - $iFrameY EndIf If $iHeight > @DesktopHeight Then $iHeight = @DesktopHeight Local $hWnd = GUICreate($Title, $iWidth, $iHeight, $iLeft, $iTop, $iStyle, $iexStyle, $hParent) WinMove($hWnd, "", Int((@DesktopWidth - $iWidth) / 2), Int((@DesktopHeight - $iHeight) / 2), $iWidth, $iHeight) Return $hWnd EndFunc ;==>_GUICreateExThe syntax, of course, is the same as the native function!So long,JS Edited June 2, 2014 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now