문제

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.

도움이 되었습니까?

해결책

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);

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top