Spy On .NET Events

M

Martijn Mulder

A general question and a specific one.

1. Is there a Spy utility that shows events for a .NET application
2. What events are fired when calling Form.Show()
?
 
C

Colby Africa

A general question and a specific one.

1. Is there a Spy utility that shows events for a .NET application
2. What events are fired when calling Form.Show()
?

I have a similiar requirement and have not found a good solution. I
have submitted a request to Dino Dino Dino Esposito of MSDN. If I get
something back, I will post it here.

Colby
 
N

Nicholas Paldino [.NET/C# MVP]

If there was a spy utility, it would have to hook into the CLR itself
(and probablys low down your app in the process, as it would use the
debugging hooks, most likely) to find when events are fired. AFAIK, there
isn't any such thing.

There might be solutions which work by requiring you to place code in
the event firing sites, but I doublt that is what you are looking for.

When calling the Show method on a Form, the Shown event will be fired if
it is the first time the form is shown. The VisibleChanged event can be
fired if the form is hidden as well. The Activate event can also be fired
as well, I believe.
 
W

Willy Denoyette [MVP]

Martijn Mulder said:
A general question and a specific one.

1. Is there a Spy utility that shows events for a .NET application
2. What events are fired when calling Form.Show()
?


Events are nothing more than Windows Messages posted to the Message Queue of
the owning thread of a Window. If you want to view the messages posted to a
specific application/thread/window, you can use is Spyxx.exe included with
VS2005 (Check Common7\tools).

Willy.
 
J

Jon Skeet [C# MVP]

Events are nothing more than Windows Messages posted to the Message Queue of
the owning thread of a Window. If you want to view the messages posted to a
specific application/thread/window, you can use is Spyxx.exe included with
VS2005 (Check Common7\tools).

Well, they *may* be Windows Messages - but not all events will involve
that. It's worth the OP being clear about the different between .NET
events and Windows Messages.

Jon
 
W

Willy Denoyette [MVP]

Jon Skeet said:
Well, they *may* be Windows Messages - but not all events will involve
that. It's worth the OP being clear about the different between .NET
events and Windows Messages.

Jon


True, I have no idea what he meant with Q #3 , Q #1 needs some
clarification, but #2 makes me think he's after the "Windows" Events.

Willy.
 
L

Liz

I don't see any Spy*.exe files in my \Common7\* folders; I have VS 2005
Pro; is there another location?
 
J

Jon Skeet [C# MVP]

True, I have no idea what he meant with Q #3 , Q #1 needs some
clarification, but #2 makes me think he's after the "Windows" Events.

Possibly - or possibly the events that he might be able to subscribe
to, only some of which will relate to Windows events. It's unfortunate
that "event" is a fairly overloaded word :(

Jon
 
W

Willy Denoyette [MVP]

Liz said:
I don't see any Spy*.exe files in my \Common7\* folders; I have VS 2005
Pro; is there another location?


Spyxx.exe should be in Common7\tools if you did install the tools during
VS2005 set-up.

Willy.
 
W

Willy Denoyette [MVP]

Jon Skeet said:
Possibly - or possibly the events that he might be able to subscribe
to, only some of which will relate to Windows events. It's unfortunate
that "event" is a fairly overloaded word :(

Jon


Overloaded is the least I can say, it's sometimes really confusing and
utterly wrong to use "Event", IMO we'll have to wait for the OP to come to
rescue and help us out of this ;-)

Willy.
 
B

Ben Voigt [C++ MVP]

Martijn Mulder said:
A general question and a specific one.

1. Is there a Spy utility that shows events for a .NET application

Perhaps you could put a tracepoint on Component.Events getter. This should
work for most if not all Control events. You'd need to print out the name
of the caller method though, I'm not sure if there's a tracepoint syntax for
that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top