However, it would be great if I can interact with the application (such as click on a button) and see how variables (such as msg) changes in the memory. Is it possible in Visual Studio? |
Debugging a Win32 GUI app is the same as debugging a console app except for two differences. The first is with a console app, you essentially know the calling sequence of your code beforehand, whereas with a GUI app, your code only runs when a message has been sent (otherwise, its idling or waiting in a message loop). The second (major) difference is when you debug a GUI app, you may disrupt the message sequence. That is, when the debugger appears, your mouse is now hovering over the debugger, when in normal execution, you would have been initiating WM_MOUSEOVER events, for example. To get over this, you could use dual monitors, remote debugging, or simply trying to place your window and debugger window side by side.
That said, you
can see how variables change in memory when debugging a Win32 app. Once your code hits a breakpoint, you're able to see the call stack just like in a console app (though it might start in an unfamiliar place) and you're able to watch variables, hover over variables and see their contents, open the memory window, etc. You can of course do all that until your app's execution is handed back over to the message loop.
You can't see how "[messages] change in memory" because they're just pre-defined values. However, I think what you might want is a
spy tool, such as Spy++, which essentially lets you see window messages as they occur (amongst other things).
http://msdn.microsoft.com/en-us/library/dd460760.aspx
So if you have some suggestions or some books/tutorials to recommend, I'll appreciate it. |
Sorry, I don't :s I've learned mostly through practice and sifting through MSDN. That said, if you're unsure of the workings of a particular Windows message or API call, there's always MSDN :)