Posts: 331
Threads: 60
Joined: May 2006
Can EN_SETFOCUS be sent to an outside APP ? with SendMessage maybe, if so how.
Thanks
P.S..... WM_SETFOCUS doesnt seem to be working right for what im doing.
Posts: 12,140
Threads: 142
Joined: Dec 2002
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.