Rodger Posted August 6, 2011 Posted August 6, 2011 Hello, I am trying to resize a RichEdit Control by using GUICtrlSetResizing($hRichEdit, $GUI_DOCKTOP + $GUI_DOCKBOTTOM) but it doesn't work. Any ideas? Rodger
wakillon Posted August 6, 2011 Posted August 6, 2011 GUICtrlSetResizing doesn't work with RichEdit control.you must use GuiRegisterMsg function.Look at the help file AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Rodger Posted August 6, 2011 Author Posted August 6, 2011 I am using the following now: $msg = GUIGetMsg() Case $msg = $GUI_EVENT_MAXIMIZE GUICtrlSetPos ( $hRichEdit, 5, 5, 3000, 750 ) but GUICtrlSetPos does not work. Is there an example script which I can use?
wakillon Posted August 6, 2011 Posted August 6, 2011 I talk about GuiRegisterMsg, not GUIGetMsg ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
Rodger Posted August 6, 2011 Author Posted August 6, 2011 Your right ! I found also some code which I could use.... expandcollapse popup; variables for resizing the RichEditCtrl $FirstTimeResize = True $iGUIH = _WinAPI_GetClientHeight ($GUI_PATT) $iGUIW = _WinAPI_GetClientWidth ($GUI_PATT) ; Resize the RichEditBox and status bar when GUI size changes Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) ConsoleWrite("Resize" & @CRLF) Local $iNewH, $iNewW, $iDltH, $iDltW, $iConH, $iConW ; Get the new GUI size $iNewW = _WinApi_LoWord ($ilParam) $iNewH = _WinApi_HiWord ($ilParam) ; Get the delta change in the GUI size $iDltW = $iNewW - $iGUIW $iDltH = $iNewH - $iGUIH ; Resize the control $iConW = _WinAPI_GetWindowWidth ($PATT_Edit) + $iDltW $iConH = _WinAPI_GetWindowHeight ($PATT_Edit) + $iDltH ; Because of the StatusBar, we need to correct the Height If $iDltH > 0 Then If $FirstTimeResize = True Then $iConH = $iConH + 20 $FirstTimeResize = False EndIf Else $iConW = 1220 $iConH = 665 EndIf _WinAPI_SetWindowPos ($PATT_Edit, 0, 0, 0, $iConW, $iConH, BitOR($SWP_NOMOVE, $SWP_NOZORDER)) ; Update GUI size variables $iGUIW = $iNewW $iGUIH = $iNewH _GUICtrlStatusBar_Resize ($hStatus) Return $GUI_RUNDEFMSG EndFunc Thanks !!
wakillon Posted August 6, 2011 Posted August 6, 2011 Glad to help you ! is an example .Look at GuiRegisterMsg and WM_GETMINMAXINFO for set min and max RichEdit Size. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
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