GetWindowText(strInput);
// reset text to clear up residual selecting font appearance
SetWindowText(strInput);
// keep cursor at the ending of texts
if (strInput.IsEmpty())
{
SetSel(0, 0);
}
else
{
SetSel(strInput.GetLength(), strInput.GetLength());
}