Skip to content
SunnyCapturerPublic

About

纯 Windows 控制台工具:通过 UI Automation 探测光标下的窗口与控件树,并可驱动窗口滚动,用于滚动截图实验。 Windows console tool that probes the window under the cursor through UI Automation and drives its scroll pattern, an experiment toward scroll capture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 简体中文

scroll

C++ Windows UI Automation

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.

Features

  • 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 of GetWindowRect, so the invisible resize border is excluded.
  • UI element dump — the HWND is turned into an IUIAutomationElement and the control view is walked recursively, printing each element's control type and bounding rectangle.
  • Scroll automation — ScrollWindowDown() acquires the UIA ScrollPattern and 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 in main().

Build

  • Visual Studio 2022 (toolset v143), Windows SDK 10.
  • Open scroll.sln, pick Debug/Release and x64/x86, then build — this produces the console executable scroll.exe, linked against dwmapi.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.

Related

About

纯 Windows 控制台工具:通过 UI Automation 探测光标下的窗口与控件树,并可驱动窗口滚动,用于滚动截图实验。 Windows console tool that probes the window under the cursor through UI Automation and drives its scroll pattern, an experiment toward scroll capture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages