MCPcopy Create free account
hub / github.com/WallBreaker2/op / SendString

Method SendString

libop/window/WindowText.cpp:217–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217long WindowService::SendString(HWND hwnd, const std::wstring &s) {
218 if (!::IsWindow(hwnd))
219 return 0;
220
221 HWND target = ResolveInputTargetWindow(hwnd);
222 if (!::IsWindow(target))
223 return 0;
224
225 auto p = s.data();
226 for (size_t i = 0; i < s.length(); ++i) {
227 bool delivered = SendCharMessage(target, WM_CHAR, p[i]);
228 if (!delivered && p[i] > 0x7f)
229 delivered = SendCharMessage(target, WM_IME_CHAR, p[i]);
230 if (!delivered)
231 return 0;
232 ::Sleep(5);
233 }
234 return 1;
235}
236
237long WindowService::SendStringIme(HWND hwnd, const std::wstring &s) {
238 if (!::IsWindow(hwnd))

Callers

nothing calls this directly

Calls 3

ResolveInputTargetWindowFunction · 0.85
SendCharMessageFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected