Question

ControlSend() works in a similar way to Send() but it can send key strokes directly to a window/control, rather than just to the active window. It takes the window/control hwnd as a parameter with keystrokes. I have used

SendMessage($_,WM_KEYDOWN, VK_RETURN, 0);
SendMessage($_,WM_KEYUP, VK_RETURN, 0); 

and

SendMessage($Ctrls5,WM_CHAR, VK_RETURN, 0);

I have also used SendKeys("{ENTER}"); but it wants the window to be present in foreground.

Help me in solving this.

Était-ce utile?

La solution

If you are sending the Enter key for carriage return in text box then you have no function for that.

But if you want to send enter key on a button or any other control(to click on it) then you can do so by the function

PushChildById(Parent_HWND ,ctrl_Hwnd);

PushChildButton(Parent_HWND , Ctrl_regex);

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top