Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EN_SETFOCUS question
Can EN_SETFOCUS be sent to an outside APP ? with SendMessage maybe, if so how.

Thanks Smile

P.S..... WM_SETFOCUS doesnt seem to be working right for what im doing.
EN_SETFOCUS and similar messages are sent by a control to its parent window. They are not real messages, but rather are sent in WM_COMMAND message.

SendMessage hwndParent WM_COMMAND EN_SETFOCUS<<16|idControl hwndControl

For idControl, if you don't know it, use GetDlgCtrlID(hwndControl). Or, if you know id but dont't know hwndControl, use id(idControl) to get hwndControl. Note that you must send message to direct parent window, which not always is top-level window. You can use GetParent(hwndControl) to get direct parent window.

Forum Jump:

Users browsing this thread: 1 Guest(s)