I want to set the cursor into an edit-ctrl preferably to a specific position. As far as I understood I have to set the focus to this ctrl and then doing a selection in that box. As SetFocus() is said not to work in dialogs properly (see http://blog.m-ri.de/index.php/2007/0...wm_nextdlgctl/), I used WM_NEXTDLGCTL to achieve that. EM_SETSEL with startpos equal to endpos shall provide positioning. Does anyone sees an error in the following which does not work as expected?
Code:
                SendMessage(WM_NEXTDLGCTL, WPARAM(GetDlgItem(Item)->m_hWnd), LPARAM(LOWORD(TRUE)));
                GetDlgItem(Item)->SendMessage(EM_SETSEL, WPARAM(INT(VarValue.length())), LPARAM(INT(VarValue.length())));
BTW: Item is the ID of the ctrl. VarValue the string being on display in the ctrl.

Many Thanks in advance for any reply!