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

Method IsCancelButton

cpp/iedriver/Alert.cpp:547–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547bool Alert::IsCancelButton(HWND button_handle) {
548 int control_id = ::GetDlgCtrlID(button_handle);
549 if (control_id != 0) {
550 return control_id == IDCANCEL || control_id == IDNO;
551 }
552 std::vector<wchar_t> button_window_class(100);
553 ::GetClassName(button_handle, &button_window_class[0], static_cast<int>(button_window_class.size()));
554 if (wcscmp(&button_window_class[0], L"Button") == 0) {
555 long window_long = ::GetWindowLong(button_handle, GWL_STYLE);
556 long button_style = window_long & BS_TYPEMASK;
557 // The BS_DEFCOMMANDLINK mask includes BS_COMMANDLINK, but we
558 // want only to match those without the default bits set.
559 return button_style == BS_COMMANDLINK || button_style == BS_PUSHBUTTON;
560 }
561 return false;
562}
563
564bool Alert::IsLinkButton(HWND button_handle) {
565 std::vector<wchar_t> button_window_class(100);

Callers

nothing calls this directly

Calls 2

GetClassNameClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected