我曾在基于XAML的UWP应用程序和实时视觉树有时证明了功能有时可以检查应用程序中UI元素的实际维度和属性。在 win32桌面应用程序中检查本机元素是否有类似的东西,我可以在该应用程序中查询本机视图的尺寸?
I have worked on XAML-based UWP apps and the Live Visual Tree feature proved handy sometimes to inspect the actual dimensions and properties of UI elements within the app. Is there something similar to inspect native elements within a Win32 desktop app where I can query the dimensions of native views within the app?
发布评论
评论(1)
由于您是专门要求使用本机窗口,因此递归致电
enumchildWindows
是适当的解决方案。拥有hwnd
后,您可以调用getWindowRect
检索窗口尺寸。Since you're specifically asking for native windows, recursively calling
EnumChildWindows
is the appropriate solution. Once you have anHWND
you can callGetWindowRect
to retrieve the window dimensions.