-
September 28th, 2014, 11:26 PM
#1
How to debug Win32 Message Loop?
You place a breakpoint at one of locations within the message loop.
But I want the breakpoint to trigger when I click on the application window, for example.
But I can't, it went so fast so long as I switch from VS to the application program,
the breakpoint is hitted again, then the application is frozen again.
I don't know how to setup a conditional breakpoint. Any pointers please?
Any ideas?
Thanks
Jack
Last edited by lucky6969b; September 28th, 2014 at 11:51 PM.
-
September 29th, 2014, 05:38 AM
#2
Re: How to debug Win32 Message Loop?
MS recommends remote debugging for GUI drawing and message queue issues.
Best regards,
Igor
-
September 30th, 2014, 04:23 AM
#3
Re: How to debug Win32 Message Loop?
Originally Posted by lucky6969b
You place a breakpoint at one of locations within the message loop.
But I want the breakpoint to trigger when I click on the application window, for example.
I highly recommend you use a dual monitor for debugging GUI issues, where Visual Studio is on one monitor, and your application is on the other monitor. Or get a very large monitor and position/resize Visual Studio's window so that it doesn't overlap your application's window.
By doing this, you don't get the chicken/egg scenario of hitting your breakpoint over and over again when you merely switch from application to Visual Studio.
Regards,
Paul McKenzie
-
October 1st, 2014, 06:32 AM
#4
Re: How to debug Win32 Message Loop?
Beside that is already answered
You can put a conditional breakpoint in the message loop, e.g. having the condition msg.message == 0x0201, where 0x0201 is the value of WM_LBUTTONDOWN.
However, it's more handy and practical to put an ordinary breakpoint in the WM_LBUTTONDOWN message handler.
Last edited by ovidiucucu; October 1st, 2014 at 06:35 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|