invoke sendmessage,hwndrichedit,em_setsel,eax,eax
to set the current selection, this time we use em_setsel because the character indices are not already in a charrange structure thus it saves us two instructions (to put those indices into a charrange structure).