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

Method GetChildWindow

cpp/iedriver/WindowUtilities.cpp:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50HWND WindowUtilities::GetChildWindow(HWND parent_window_handle,
51 std::wstring window_class) {
52 std::vector<wchar_t> class_name_buffer(window_class.size() + 1);
53 HWND hwndtmp = GetWindow(parent_window_handle, GW_CHILD);
54 while (hwndtmp != NULL) {
55 ::GetClassName(hwndtmp,
56 &class_name_buffer[0],
57 static_cast<int>(class_name_buffer.size()));
58 std::wstring actual_class = &class_name_buffer[0];
59 if (window_class == actual_class) {
60 return hwndtmp;
61 }
62 hwndtmp = GetWindow(hwndtmp, GW_HWNDNEXT);
63 }
64 return NULL;
65}
66
67std::string WindowUtilities::GetWindowCaption(HWND window_handle) {
68 std::wstring window_caption = L"";

Callers

nothing calls this directly

Calls 2

GetClassNameClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected