English | 简体中文
A small Windows console tool that inspects the window under the mouse cursor through UI Automation, and can drive that window's scroll pattern — an experiment on the road to scroll (long-page) capture.
- Cursor tracking — the pointer is polled once per second; whenever it moves, the window beneath it is inspected again.
- Accurate window frame — the title, cursor coordinates and frame bounds are printed, using
DwmGetWindowAttribute(DWMWA_EXTENDED_FRAME_BOUNDS)instead ofGetWindowRect, so the invisible resize border is excluded. - UI element dump — the HWND is turned into an
IUIAutomationElementand the control view is walked recursively, printing each element's control type and bounding rectangle. - Scroll automation —
ScrollWindowDown()acquires the UIAScrollPatternand scrolls in large increments until the vertical scroll percent reaches 100 %, reporting progress at every step (500 ms apart). - Prototype helpers —
DrawRedFrame()draws a 3 px red frame over a window with GDI, and the console code page can be switched between GBK and UTF-8; both are currently disabled inmain().
- Visual Studio 2022 (toolset
v143), Windows SDK 10. - Open
scroll.sln, pickDebug/Releaseandx64/x86, then build — this produces the console executablescroll.exe, linked againstdwmapi.lib.
Run it from a console window, move the mouse over different windows, and the window title, cursor position, frame rectangle and UI element tree are printed for every new position.
- GitHub: https://github.com/SunnyCapturer/scroll
- Window highlighting companion: https://github.com/SunnyCapturer/WindowRect