Does anyone know a tool that can capture win32 messages that get sent to a particular process? I thought there was a tool from sysinternals for that but now I can't locate it. Anyone knows some?
Spy++ comes with retail version of Visual Studio (Standard, Professional, Team)
See also: I want Spy++ but I don't have Visual Studio
Try WinSpy or Winspector
If you want to do it programmatically, you need to create a message hook
Related
I want to be able to detect when the current instance of visual studio is active or in active, but searching through the available hookable events in the _applicationObject.Events. collection has not given me any clues. I can see when a window within the application is activated/deactivated with _applicationObject.Events.WindowEvents.WindowActivated, but this is not going to help. I want to know when the who application is active, not just a document or window.
Any help appreciated.
You can get the DTE.MainWindow.HWnd handle and use the Win32 API.
You can use System.Windows.Application.Current.Deactivated and Activated events to monitor when Visual Studio becomes active.
I’m using Visual Studio 2010 to write unmanaged C++ code.
When debugging, anything printed using OutputDebugString or MFC’s TRACE macro goes to Visual Studio’s “Output” window.
I would prefer to see the output in DebugView instead, while still running under the MSVC debugger. Is this possible?
It is not possible. Whatever debugger the app runs in gets first dibs on any such messages. DebugView can only intercept the messages when the app is not running inside of any debugger.
likely not possible, by design.. if you open two DebugView instances, there's also only one receiving the messages.
I am looking for a program to view Windows messages
Can you help?
Spy++ comes with Visual Studio.
I have found Winspector to be somewhat more stable than Spy++ especially while debugging a program while at the same time monitoring messages.
Few years ago when I was doing win32 programming, there was a program (from Microsoft I believe) that helps see all messages sent to winproc real time. I think it's a dialog box with all controls and depending of the actions you do, it display messages sent to that control.
Does anyone know which program I am talking about? If so what's the name and where can I find it. Thank you.
is it spy++
The program you are looking for is Control Spy.
As others have mentioned there is also Spy++. Source is available for a Spy++-like program called WinSpy++. (More alternatives on the thread i-want-spy-but-i-dont-have-visual-studio)
It's called Spy++.
It comes with Visual Studio, and you can find it in under Start, Programs, Microsoft Visual Studio 20xx, Visual Studio Tools.
I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the debugger.
This relates to another question of mine on controlling when to break on exceptions.
You can write Visual Studio macros that can do anything the GUI can, but they can get rather involved. See the MSDN documentation on Automation and Extensibility for Visual Studio
Doing this from the code being debugged would be tricky, you would definitely need some new form of communication with VS, maybe a custom add-in. I don't think an independent service would fundamentally help here. The biggest problem is that your code will stop running when the debugger breaks.
I know that you can do it with WinDBG and OutputDebugString, but for Visual Studio, I think you have to spool off another process, pipe commands to that, and have that manipulate the Debugger API.