Esempio n. 1
0
BOOL CALLBACK Alert::FindTextBoxes(HWND hwnd, LPARAM arg) {
  std::vector<HWND>* dialog_handles = reinterpret_cast<std::vector<HWND>*>(arg);
  std::vector<wchar_t> child_window_class(100);
  ::GetClassName(hwnd, &child_window_class[0], 100);

  if (wcscmp(&child_window_class[0], L"Edit") == 0) {
    dialog_handles->push_back(hwnd);
  }
  return TRUE;
}
Esempio n. 2
0
BOOL CALLBACK Alert::FindDirectUIChild(HWND hwnd, LPARAM arg){
  HWND *dialog_handle = reinterpret_cast<HWND*>(arg);
  std::vector<wchar_t> child_window_class(100);
  ::GetClassName(hwnd, &child_window_class[0], 100);

  if (wcscmp(&child_window_class[0], L"DirectUIHWND") != 0) {
    return TRUE;
  }
  *dialog_handle = hwnd;
  return FALSE;
}
Esempio n. 3
0
bool Alert::IsPasswordEdit(HWND edit_handle) {
  std::vector<wchar_t> child_window_class(100);
  ::GetClassName(edit_handle, &child_window_class[0], 100);

  if (wcscmp(&child_window_class[0], L"Edit") == 0) {
    long window_long = ::GetWindowLong(edit_handle, GWL_STYLE);
    bool is_password = (window_long & ES_PASSWORD) == ES_PASSWORD;
    return is_password;
  }
  return false;
}
Esempio n. 4
0
BOOL CALLBACK Alert::FindTextBox(HWND hwnd, LPARAM arg) {
  HWND *dialog_handle = reinterpret_cast<HWND*>(arg);
  std::vector<wchar_t> child_window_class(100);
  ::GetClassName(hwnd, &child_window_class[0], 100);

  if (wcscmp(&child_window_class[0], L"Edit") == 0) {
    *dialog_handle = hwnd;
    return FALSE;
  }
  return TRUE;
}
Esempio n. 5
0
BOOL CALLBACK Alert::FindTextLabel(HWND hwnd, LPARAM arg) {
  TextLabelFindInfo* find_info = reinterpret_cast<TextLabelFindInfo*>(arg);
  std::vector<wchar_t> child_window_class(100);
  ::GetClassName(hwnd, &child_window_class[0], 100);

  if (wcscmp(&child_window_class[0], L"Static") != 0) {
    return TRUE;
  }

  int control_id = ::GetDlgCtrlID(hwnd);
  int text_length = ::GetWindowTextLength(hwnd);
  if (text_length > 0) {
    if (find_info->excluded_control_id == 0 ||
        control_id != find_info->excluded_control_id) {
      find_info->label_handle = hwnd;
      find_info->control_id_found = control_id;
      return FALSE;
    }
  }
  return TRUE;
}