Run clang-format (the repo's .clang-format: LLVM base, 120 cols, tabs, Allman functions) over every source file so the tree is formatter-clean. Whitespace only -- no behavior change; full x64 + x86 suites pass. Also set SortIncludes: false in .clang-format. Windows include order is load-bearing (windows.h must precede tlhelp32.h / mmreg.h / xinput.h / dinput.h; winsock2.h must precede windows.h), and the default alphabetical sort reorders tlhelp32.h ahead of windows.h -- a build break. Leaving order alone keeps the manual, correct grouping.
23 lines
798 B
C++
23 lines
798 B
C++
// Enumerates visible top-level windows for the injection target picker. There are
|
|
// far fewer windows than processes, and a window maps directly to the HWND the
|
|
// capturer wants, so this is the default (friendlier) way to pick a game.
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace coop {
|
|
|
|
struct WindowEntry {
|
|
unsigned long pid = 0; // owning process id
|
|
void* hwnd = nullptr; // HWND (opaque here to keep windows.h out of the header)
|
|
std::wstring title; // window caption
|
|
std::wstring exe_name; // owning process image base name, e.g. "game.exe"
|
|
};
|
|
|
|
// Snapshot of the visible, titled, non-tool top-level (alt-tab-style) windows, with
|
|
// our own process's windows excluded. Sorted by title (case-insensitive).
|
|
std::vector<WindowEntry> list_windows();
|
|
|
|
} // namespace coop
|