How to simulate entering text in a CEdit
-
I want to simultate that the user typed some text in a single line CEdit control (in another application) and then pressed the Enter key. The problem is I want it done without the control having keyboard focus. I found the control's handle, I tried sending the WM_SETTEXT message with the text and it works, regardless of the keyboard focus, But when I tried sending the WM_KEYDOWN or WM_CHAR message with the VK_ENTER key it only works if the control has keyboard focus. Does anyone know how to solve this problem? Thx
-
I want to simultate that the user typed some text in a single line CEdit control (in another application) and then pressed the Enter key. The problem is I want it done without the control having keyboard focus. I found the control's handle, I tried sending the WM_SETTEXT message with the text and it works, regardless of the keyboard focus, But when I tried sending the WM_KEYDOWN or WM_CHAR message with the VK_ENTER key it only works if the control has keyboard focus. Does anyone know how to solve this problem? Thx
I may be totally misunderstanding your question but if the WM_SETTEXT gives you the desired functionality, to make it look like some one is typing could you not just call WM_SETTEXT multiple times...for example to 'type' Hello could you not do WM_SETTEXT 'H' WM_SETTEXT 'He' WM_SETTEXT 'Hel' WM_SETTEXT 'Hell' WM_SETTEXT 'Hello'
cje