开发者

Send Text to an inputbox using win32 api

开发者 https://www.devze.com 2022-12-08 10:56 出处:网络
I\'m trying开发者_运维问答 to send some text to an inputput box using win32. Some text appears in the inputbox, but it is all jumbled (?????????a??????).

I'm trying开发者_运维问答 to send some text to an inputput box using win32. Some text appears in the inputbox, but it is all jumbled (?????????a??????).

The code is :

SendMessage(myHandle, WM_SETTEXT, 1, "A")


I don't know if this is the root cause, but as long as the target window (edit box in your case) is in the same process, you should call SetWindowText() rather than sending WM_TEXT directly.

HTH,


It should be something like this as mentioned below:-

SendMessage(myHandle,WM_SETTEXT,NULL,(LPARAM)L"A");
0

精彩评论

暂无评论...
验证码 换一张
取 消