zeffy Posted January 6, 2011 Share Posted January 6, 2011 (edited) I know GUICtrlSetResizing() only works with the default autoit GUI controls, so I was wondering how I could use ControlMove() or something similar to accomplish the same thing? Thanks Edited January 6, 2011 by zeffy Link to comment Share on other sites More sharing options...
Mat Posted January 6, 2011 Share Posted January 6, 2011 You have to handle the WM_SIZE message yourself unfortunately, and then use ControlMove (Or MoveWindow as I have). This means doing all the maths yourself as well, as you don't get the easy to use resizing flags. This is a simple case with a 2px border on all sides, so the maths wasn't hard. #include<GUIRichEdit.au3> #include<WindowsConstants.au3> #include<EditConstants.au3> #include<WinAPI.au3> Global $hGUI = GUICreate("Testing WM_SIZE", 350, 250, -1, -1, BitOR($WS_THICKFRAME, $WS_POPUP, $WS_CAPTION, $WS_SYSMENU)) Global $hRichEdit = _GUICtrlRichEdit_Create($hGUI, "This is a test.", 2, 2, 346, 246, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUISetState() While True $iMsg = GUIGetMsg() Select Case $iMsg = -3 _GUICtrlRichEdit_Destroy($hRichEdit) GUIDelete() Exit EndSelect WEnd Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) Local $iWidth = _WinAPI_LoWord($lParam) Local $iHeight = _WinAPI_HiWord($lParam) _WinAPI_MoveWindow($hRichEdit, 2, 2, $iWidth - 4, $iHeight - 4) Return 0 EndFunc ;==>WM_SIZE mLipok, TheDcoder and pixelsearch 3 AutoIt Project Listing Link to comment Share on other sites More sharing options...
zeffy Posted January 6, 2011 Author Share Posted January 6, 2011 Ok, thanks bro Link to comment Share on other sites More sharing options...
martin Posted January 11, 2011 Share Posted January 11, 2011 (edited) You can dispense with the maths if you are as lazy as I am and easily deal with any resizing method that is available for standard controls. Draw a label and set the sizeand position to be the same as the richedit at design time, and set the resizing for that as you want. Then, when you handle the resizing for the richedit you only have to copy the label size and position (using ControlGetPos). Just set the label to not visible of course. Edited January 11, 2011 by martin pixelsearch 1 Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
mike2003 Posted January 17, 2020 Share Posted January 17, 2020 (edited) But after GUIRegisterMsg($WM_SIZE, "WM_SIZE") All other controls stop resizing and moving. Quote to copy the label size and position And how? Edited January 17, 2020 by mike2003 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