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

Method IsOKButton

cpp/iedriver/Alert.cpp:532–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530}
531
532bool Alert::IsOKButton(HWND button_handle) {
533 int control_id = ::GetDlgCtrlID(button_handle);
534 if (control_id != 0) {
535 return control_id == IDOK || control_id == IDYES || control_id == IDRETRY;
536 }
537 std::vector<wchar_t> button_window_class(100);
538 ::GetClassName(button_handle, &button_window_class[0], static_cast<int>(button_window_class.size()));
539 if (wcscmp(&button_window_class[0], L"Button") == 0) {
540 long window_long = ::GetWindowLong(button_handle, GWL_STYLE);
541 long button_style = window_long & BS_TYPEMASK;
542 return button_style == BS_DEFCOMMANDLINK || button_style == BS_DEFPUSHBUTTON;
543 }
544 return false;
545}
546
547bool Alert::IsCancelButton(HWND button_handle) {
548 int control_id = ::GetDlgCtrlID(button_handle);

Callers

nothing calls this directly

Calls 2

GetClassNameClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected