Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view information about a HWND within visual studio while debugging?

Are there any well known tools or plugins I can use to get properties about HWNDs while debugging / stepping through Visual Studio? I know I can use Spy++ for these things, but it's cumbersome to do so while also stepping in the debugger. What I'd love to do is drop a HWND into a Watch child window and see things such as:

  • Client Rect
  • Window Rect
  • Styles / Extended Styles
  • The window's class in human-readable form
  • The window's name (::SetWindowText)
  • etc.

This seems like pretty basic stuff to me that would be useful to anyone. Does such a plugin exist? Can I accomplish this by playing games with Autoexp.dat?

like image 660
Armentage Avatar asked Mar 12 '12 22:03

Armentage


1 Answers

I don't know if you can do this in Visual Studio, but windbg has an extension (userexts) that can display quite a bit of info about HWNDs.

!userexts.dw -v hwnd

will dump all that you ask and more.

Apparently you can integrate Visual Studio and Windbg according to this blog article; you can attach to a process and use the immediate window to execute windbg extensions.

like image 167
Eric Brown Avatar answered Nov 08 '22 20:11

Eric Brown