I think your code is wrong. you must use the parameter "EM_SETSEL". my problem is solved with this code:
//Set a value for external textbox
SendMessage(h1, WM_SETTEXT, 0, Integer(PChar(C)));
//move the cursor to end of the textbox(editbox,field,...)
SendMessage(h1, EM_SETSEL, length(C), length(C));
, :)