Unable to set cursor & focus in edit box (CEdit)



Hi,
I have an edit box for which I am using a class which is inheriting from CEdit for overriding PreTranslateMessage.

I am intercepting Ctrl+K from this class. when this key is pressed, it posts a message to the dialog.

As a result of this key press the whole text in the edit box is changed.

Now, I am trying to set focus & the cursor to the end of the text. I tried calling these methods

CEdit::SetFocus();
CEdit::SetSel(-1,FALSE);

but its not setting the focus even. Can someone please tell me whats wrong or whats need to be done here?

Regards,
Ashutosh
.



Relevant Pages

  • Exporting from Access to Word
    ... I am wondering if someone could help me solve how to reference, access, edit or set focus to a currently present (running/existing) word document from within Access? ...
    (microsoft.public.access.formscoding)
  • Re: RBAC access granularity
    ... whats to keep a vi process with elevated privileges from ... > user x to edit file y without any unpleasant side effects. ... replaces the file with a new one, and have the script or program check ...
    (comp.unix.solaris)
  • CreateThread and BeginThreadex
    ... Whats the difference between CreateThread and ... VC++ query: ... In edit box I want to prevent user from entering any ...
    (microsoft.public.vc.mfc)
  • Re: ListBox with no selected item
    ... It seems to be a problem that happens when the Edit Box has Tab Order 1 and gets the focus when Dialog is displayed. ... So I created an invisible CButton which has Tab Order 1, when Edit has Tab Order 2. ... I set focus to the CButton when loading the Dialog, and the Edit content is no more selected. ...
    (microsoft.public.vc.mfc)
  • Re: Getting a hard drive for a Aptiva?
    ... there isn't a edit button. ... Probably should have mentioned this little oddity before. ... See whats on the mainboard. ...
    (comp.sys.ibm.pc.hardware.storage)

Loading