rizaado Posted June 30, 2015 Posted June 30, 2015 (edited) Func GUICtrlGetSize($iControlID) Local $hControlID = GUICtrlGetHandle($iControlID) Local $aControlPos[2] $aControlPos[0] = ControlGetPos($hControlID, "", 0)[2] ;width $aControlPos[1] = ControlGetPos($hControlID, "", 0)[3] ;height Return $aControlPos EndFunc ;==>GUICtrlGetSizePurpose: Get the width and height of control.My Purpose: Get the width and height of images(controls). Edited June 30, 2015 by rizaado
rizaado Posted June 30, 2015 Author Posted June 30, 2015 I haven't just run tidy. I am going to edit the post.Before edit:Func GUICtrlGetSize($iControlID) Local $hControlID = GUICtrlGetHandle($iControlID) Local $aControlPos[2] $aControlPos[0] = ControlGetPos($hControlID, "", 0)[2] $aControlPos[1] = ControlGetPos($hControlID, "", 0)[3] Return $aControlPos EndFunc ;==>GUICtrlGetPos
wakillon Posted June 30, 2015 Posted June 30, 2015 you can also use WinGetPos Func GUICtrlGetSize($iControlID) Local $hControl = GUICtrlGetHandle($iControlID), $aControlPos[2] = [WinGetPos($hControl)[2], WinGetPos($hControl)[3]] Return $aControlPos EndFunc ;==>GUICtrlGetSize AutoIt 3.3.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
rizaado Posted July 1, 2015 Author Posted July 1, 2015 Divide GUICtrlGetSize into two functions - "getWidth" and "getHeight"! It is better solution.
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