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

Method GetActiveDialogWindowHandle

cpp/iedriver/HtmlDialog.cpp:209–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209HWND HtmlDialog::GetActiveDialogWindowHandle() {
210 LOG(TRACE) << "Entering HtmlDialog::GetActiveDialogWindowHandle";
211 DialogWindowInfo info;
212 info.hwndOwner = this->GetTopLevelWindowHandle();
213 info.hwndDialog = NULL;
214 if (info.hwndOwner != NULL) {
215 ::EnumWindows(&HtmlDialog::FindChildDialogWindow, reinterpret_cast<LPARAM>(&info));
216 }
217 if (info.hwndDialog != NULL) {
218 std::vector<char> window_class_name(34);
219 if (::GetClassNameA(info.hwndDialog, &window_class_name[0], 34)) {
220 if (strcmp(HTML_DIALOG_WINDOW_CLASS, &window_class_name[0]) == 0) {
221 HWND content_window_handle = this->FindContentWindowHandle(info.hwndDialog);
222 if (content_window_handle != NULL) {
223 // Must have a sleep here to give IE a chance to draw the window.
224 ::Sleep(250);
225 ::PostMessage(this->executor_handle(),
226 WD_NEW_HTML_DIALOG,
227 NULL,
228 reinterpret_cast<LPARAM>(content_window_handle));
229 }
230 }
231 }
232 }
233 return info.hwndDialog;
234}
235
236long HtmlDialog::GetWidth() {
237 LOG(TRACE) << "Entering HtmlDialog::GetWidth";

Callers 1

WaitMethod · 0.95

Calls 4

executor_handleMethod · 0.80
LOGClass · 0.50

Tested by

no test coverage detected