I think that you forgot something here.
I was messing with this and it was missing a character, so I changed 1 small thing, only one of the variables _tmpSize was _tmpSize + 1, so I put the other as + 1 and it retrieved all of the text.
Code:
Else If _action = GetText
{
VarSetCapacity(_tmp3, 20, 0)
If (opt1)
_tmp2 = 1200
Else
_tmp2 = 1252
VarSetCapacity(_tmp1, 8, 0)
NumPut(0, _tmp1, 0)
NumPut(_tmp2, _tmp1, 4)
_tmpSize := DllCall("user32.dll\SendMessage", "UInt", _ctrlID, "UInt", 0x45F, "UInt", &_tmp1, "UInt", "0")
If (_tmpSize) {
NumPut(_tmpSize, _tmp3, 0, "Int")
NumPut(_tmp2, _tmp3, 8, "Int")
VarSetCapacity(_tmp4, _tmpSize + 1, 0)
DllCall("user32.dll\SendMessage", "UInt", _ctrlID, "UInt", 0x45E, "UInt", &_tmp3, "UInt", &_tmp4)
VarSetCapacity(_tmp4, -1)
}
Return _tmp4
}
Code:
NumPut(_tmpSize + 1, _tmp3, 0, "Int")
NumPut(_tmp2, _tmp3, 8, "Int")
VarSetCapacity(_tmp4, _tmpSize + 1, 0)
cRichEdit.ahk
Version 0.09 beta
April 19, 2008