MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / attachInputToIEThread

Function attachInputToIEThread

cpp/webdriver-interactions/interactions.cpp:350–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350static HKL attachInputToIEThread(HWND directInputTo)
351{
352 DWORD currThreadId = GetCurrentThreadId();
353 DWORD ieWinThreadId = GetWindowThreadProcessId(directInputTo, NULL);
354
355 GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCTSTR)
356 &sendKeys, &moduleHandle);
357
358 hook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC) &GetMessageProc,
359 moduleHandle, ieWinThreadId);
360
361 if (hook == NULL) {
362 LOGERR(WARN) << "Unable to set Windows hook. Individual keystrokes will be very slow";
363 }
364
365 // Attach to the IE thread so we can send keys to it.
366 if (ieWinThreadId != currThreadId) {
367 AttachThreadInput(currThreadId, ieWinThreadId, true);
368 }
369
370 return GetKeyboardLayout(ieWinThreadId);
371}
372
373static void detachInputFromIEThread(HWND directInputTo)
374{

Callers 2

sendKeysFunction · 0.85
releaseModifierKeysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected