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

Method GetTopLevelWindowHandle

cpp/iedriver/HtmlDialog.cpp:190–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190HWND HtmlDialog::GetTopLevelWindowHandle(void) {
191 LOG(TRACE) << "Entering HtmlDialog::GetTopLevelWindowHandle";
192 HWND parent_handle = ::GetParent(this->window_handle());
193
194 // "Internet Explorer_Hidden\0" == 25
195 std::vector<char> parent_class_buffer(25);
196 if (::GetClassNameA(parent_handle, &parent_class_buffer[0], 25)) {
197 if (strcmp(HIDDEN_PARENT_WINDOW_CLASS, &parent_class_buffer[0]) == 0) {
198 // Some versions of Internet Explorer re-parent a closing showModalDialog
199 // window to a hidden parent window. If that is what we see happening
200 // here, that will be equivalent to the parent window no longer being
201 // valid, and we can return an invalid handle, indicating the window is
202 // "closed."
203 return NULL;
204 }
205 }
206 return parent_handle;
207}
208
209HWND HtmlDialog::GetActiveDialogWindowHandle() {
210 LOG(TRACE) << "Entering HtmlDialog::GetActiveDialogWindowHandle";

Callers 2

IsValidWindowMethod · 0.95

Calls 2

LOGClass · 0.50
window_handleMethod · 0.45

Tested by

no test coverage detected