user26901
user26901

Reputation:

Software to monitor events fired from code

I'm having trouble within a block of code that I believe is related to a mouse click event but I cannot seem to capture the exact event within my code. I've used the C# debugger to step through my code and after the end of one of my events the code simply locks up.

The purpose of my post is to ask if there is any software that will watch my process and let me know the events that are firing off after I hit the F11 key and the code freezes up. I've tried SysInternals' procmon.exe but that isn't telling me which events are firing off.

Upvotes: 2

Views: 3343

Answers (4)

JeffH
JeffH

Reputation: 10482

Have you tried Spy++ ? It's a tool that comes with Visual Studio (at least 2003 & 2005). On my default 2003 and 2005 installs, Spy++ is at: Start | Program Files | Microsoft Visual Studio 200X | Visual Studio Tools | Spy++

After you run Spy++, select Find Window... from the Search menu. Drag the "Finder Tool" to the window or control you want to watch events on and click OK. Right-click on the item selected in the tree and select "Messages". This will bring up a window that shows the messages as they hit your window of interest.

If Spy++ doesn't get what you need, what about Managed Spy? It appears to be like Spy++ but specifically for managed code. I haven't tried it.

[It] displays a treeview of controls in your .NET-based client application. You can select any control and get or set any property on it. You can also log a filtered set of events that the control raises.

Upvotes: 3

John MacIntyre
John MacIntyre

Reputation: 13031

CLRProfiler might do what you want.

The tool overview states

The CLR Profiler includes a number of very useful views of the allocation profile, including a histogram of allocated types, allocation and call graphs, a time line showing GCs of various generations and the resulting state of the managed heap after those collections, and a call tree showing per-method allocations and assembly loads.

The memory use is really sold in this description, but it does mention the 'call tree', and this link on how to use it, mentions

Call Tree View Provides a text-based, chronological, hierarchical view of your application's execution.

Good luck.

Upvotes: -1

si618
si618

Reputation: 16858

Why not use a logging tool like log4net?

Upvotes: -1

Nick Bolton
Nick Bolton

Reputation: 39680

Are you using multi-threading? If so, try to avoid passing controls and other Windows Forms objects out side of the forms thread, as the debugger will try to access the object's value, which will cause the debugger to freeze for some time.

Upvotes: 1

Related Questions