16

When I run Snoop 2.8, it sees my program's main window and lists it in its ComboBox. However, my program creates a child window that is displayed by calling ChildWindow.Show(). No matter what I do, I can't snoop that child window. If I refresh the list of windows, it doesn't show up. If I drag the little cross hairs icon next to the binoculars over the child window, the main window comes up.

How do I Snoop my applicaton's child window?

Tony Vitabile
  • 8,298
  • 15
  • 67
  • 123
  • are you sure the version is 6.8? I don't know this software but I found only [version 2.8.0](https://github.com/cplotts/snoopwpf/downloads) – vault Feb 28 '13 at 14:13
  • It's 2.8, not 6.8. I corrected my question. I don't know where the 6.8 came from. – Tony Vitabile Feb 28 '13 at 14:57

2 Answers2

51

When I use Snoop, I always first start snoop and then use the "shift+control" shortcut to focus on what I want. This seems to work even if I do it to a child window. So try this:

  1. Start application, open child window
  2. Run Snoop
  3. Snoop any window in the application
  4. Focus on your child window (click on the title bar of the window)
  5. Move the mouse over what you want to inspect, and hold down the Shift and Control keys simultaneously
  6. A red outline appears in your application, and you should see Snoop show/select the element in question in the tree. If you look up the visual tree on the left you will now see the child window is the parent of the tree.

This solution was last tested in Snoop 2.8.

Dana Cartwright
  • 1,566
  • 17
  • 26
  • 2
    Thanks, this does work. Though there should be a more obvious way to snoop a child window from the UI. Like put a `Tree` control in the `ComboBox's ' drop down and show all child windows as a heirarchy of the main window. – Tony Vitabile Feb 28 '13 at 16:54
  • Many Thanks ! Indeed steps execution order matters ! I had my snoop app. open before displaying the child window and somehow I was not able to get the outline focus on it ! – Seb T. Jun 02 '14 at 15:12
2

Have you ever look for WPF Inspector? I always use it instead of snoop and and never had any problem with child windows...

http://wpfinspector.codeplex.com/

mlemay
  • 1,622
  • 2
  • 32
  • 53