[go: nahoru, domu]

blob: 663df52b53f15d9adb9909ec224b1e6089aedf06 [file] [log] [blame]
S. Ganesh42998b02023-09-14 20:18:431// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_WIN_WINDOW_ENUMERATOR_H_
6#define BASE_WIN_WINDOW_ENUMERATOR_H_
7
S. Ganesh42998b02023-09-14 20:18:438#include <string>
9
10#include "base/base_export.h"
11#include "base/functional/callback.h"
Greg Thompson75b1a062023-09-18 00:08:3612#include "base/win/windows_types.h"
S. Ganesh42998b02023-09-14 20:18:4313
14namespace base::win {
15
Greg Thompson75b1a062023-09-18 00:08:3616// Enumerates immediate child windows of `parent`, running `filter` for each
17// window until `filter` returns true.
18using WindowEnumeratorCallback = base::RepeatingCallback<bool(HWND hwnd)>;
19BASE_EXPORT void EnumerateChildWindows(HWND parent,
20 WindowEnumeratorCallback filter);
S. Ganesh42998b02023-09-14 20:18:4321
Greg Thompson75b1a062023-09-18 00:08:3622// Returns true if `hwnd` is an always-on-top window.
23BASE_EXPORT bool IsTopmostWindow(HWND hwnd);
S. Ganesh42998b02023-09-14 20:18:4324
Greg Thompson75b1a062023-09-18 00:08:3625// Returns true if `hwnd` is a system dialog.
26BASE_EXPORT bool IsSystemDialog(HWND hwnd);
S. Ganesh42998b02023-09-14 20:18:4327
Greg Thompson75b1a062023-09-18 00:08:3628// Returns true if `hwnd` is a window owned by the Windows shell.
29BASE_EXPORT bool IsShellWindow(HWND hwnd);
S. Ganesh42998b02023-09-14 20:18:4330
Greg Thompson75b1a062023-09-18 00:08:3631// Returns the class name of `hwnd` or an empty string on error.
32BASE_EXPORT std::wstring GetWindowClass(HWND hwnd);
S. Ganesh42998b02023-09-14 20:18:4333
Greg Thompson75b1a062023-09-18 00:08:3634// Returns the window text for `hwnd`, or an empty string on error.
35BASE_EXPORT std::wstring GetWindowTextString(HWND hwnd);
S. Ganesh42998b02023-09-14 20:18:4336
37} // namespace base::win
38
39#endif // BASE_WIN_WINDOW_ENUMERATOR_H_