Here is a function for getting the text off of one because I couldn't find one, pretty simple but it works:
HE_GetText(c="", w="") { ;c is the control ClassNN, defaults to HiEdit1 ;w is the window title, defaults to nothing If c= { c=HiEdit1 } ControlGetText,t,%c%,%w% return t }
And also I have yet another request (I am using this control in a program ). Could you somehow make a function that let's you choose the syntax to use instead of it being selected just by the file extension? So then a user could select the syntax from a menu...
Heres another way. Also i'm aware that i could do select/replace/etc to archive the same thing.
HE_GetText(hEdit){ ControlGetText, t, , ahk_id %hEdit% Return t } HE_SetText(hEdit, txt=""){ ControlSetText, , %txt%, ahk_id %hEdit% Return ErrorLevel }
Update:
I quickly made these functions using the sendmessage, adapted from existing, but for some reason "WM_SETTEXT" returns false even though text is set. It should return true according to the "HiEdit.inc". Otherwise these seem to work...
HE_SetText(hEdit, txt=""){ static WM_SETTEXT:=0xC SendMessage, WM_SETTEXT, 0, &txt,, ahk_id %hEdit% Return ErrorLevel } HE_GetText(hEdit, len=-1){ static WM_GETTEXT:=0xD if (len=-1) len := HE_GetTextLength(hEdit) IfEqual,len,0,return VarSetCapacity(txt, len+1, 0) SendMessage WM_GETTEXT, len+1, &txt, , ahk_id %hEdit% if ErrorLevel=FAIL ;-- Test remains as a fail-safe { Msgbox %A_ThisFunc% failed. return } VarSetCapacity(txt,-1) Return txt }
Cheers!