uhhhh, something about the caret....lemme look quick
*browses msdn*
ok, here's a combination of code that should be helpful, some taken from OST2, some taken from msdn:
k, so we've got a message that we can use for edit boxes (found from msdn here) called EM_SETSEL meaning Edit message set selection or something like that. Anyways, here's the parameters we need to send to it:
Code:
lResult = SendMessage(
// returns LRESULT in lResult
(HWND) hWndControl,
// handle to destination control
(UINT) EM_SETSEL,
// message ID
(WPARAM) wParam,
// = (WPARAM) () wParam;
(LPARAM) lParam
// = (LPARAM) () lParam;
);
bla blah blah
Code:
wParam Specifies the starting character position of the selection.
lParam Specifies the ending character position of the selection.
Ok, so we need to know the start and end position. You said you want the selection to be at the end? then we need to find the length of the edit box:
use this function/code
Code:
DWORD TextSize;
TextSize=GetWindowTextLength(EditBox);
Where EditBox is an HWND to your editbox, duh.
So now we have the text size....here we go!
Code:
SendMessage(EdtiBox,EM_SETSEL,TextSize,TextSize);
and tadah! We've got the position set. You might also need to dabble with the caret (not carrot) position if you have a mutltiline edit control:
This is easy to do, just use this message, like so:
Code:
SendMessage(EditoBox,EM_SCROLLCARET,0,0);
and voila, it scrolls our caret (the little flashing line thingy) in to view automatically!
-hope that helps!