Jump to content

GUICtrlCreateEdit increase max length?


Recommended Posts

I have an edit box that requires a large amount of data to be entered, and it seems that I am hitting the size limit. Is there a way to increase the max amount of text that can be entered?

Below is a stripped down example:

Global Const $WM_CHAR = 0x0102
Global Const $EM_SETSEL = 0xB1
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_MINIMIZE = -4
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_EVENT_MAXIMIZE = -6
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Edit Control Test", 615, 450, 195, 124)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 593, 193)
$hEdit1 = GUICtrlGetHandle(-1)
$hFunc1 = DllCallbackRegister('_EditHandler1', 'lresult', 'hwnd;uint;wparam;lparam')
$pFunc1 = DllCallbackGetPtr($hFunc1)
GUICtrlSetData(-1, "enter large amount of data here")
$Button1 = GUICtrlCreateButton("Start", 8, 416, 65, 25)
$Button2 = GUICtrlCreateButton("Copy to Clipboard", 80, 416, 95, 25)
$Edit2 = GUICtrlCreateEdit("", 8, 232, 593, 177)
$hEdit2 = GUICtrlGetHandle(-1)
$hFunc2 = DllCallbackRegister('_EditHandler2', 'lresult', 'hwnd;uint;wparam;lparam')
$pFunc2 = DllCallbackGetPtr($hFunc2)
$Label1 = GUICtrlCreateLabel("Output:", 8, 208, 39, 17)
$Progress1 = GUICtrlCreateProgress(183, 420, 425, 17)
While 1


Edited by BPCM
Code example didn't generate the problem like I expected. Reworking it
Link to comment
Share on other sites

  • Moderators


Use GUICtrlSetLimit.


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Link to comment
Share on other sites

  • 6 years later...

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

  • Create New...