1

I have a bug that I'm trying to fix ( Odd MFC/GDI behaviour (blank image) that doesn't appear when screen is recorded ), and I think it might be because I'm calling Invalidate() before I call ShowWindow() somewhere.

I have a class that's derived from a CWnd, so I'd like to be able to see what is sending the ShowWindow message (since searching for it gives me a few thousand places in the code).

I added the ON_WM_SHOWWINDOW() to the message map and can break whenever I get a showwindow message, but I don't know who's sending it. Is there any way to tell?

Thanks!

Community
  • 1
  • 1
Jordan
  • 9,014
  • 8
  • 37
  • 47
  • Just go up the call stack and look at who is calling who!? – Werner Henze Nov 17 '11 at 16:03
  • Mfc OnWndMessage(). Not very helpful ;) At no point can I see my code in the call stack. – Jordan Nov 17 '11 at 16:09
  • 1
    Up and up the call stack! If you are reaching code insinde user32.dll or similar, load the symbols from the MS symbol server (so the stack trace will be correct) and than up again. If it is a SendMessage, you surely will (maybe a dozen functions later) come back to your code. – Werner Henze Nov 17 '11 at 16:19
  • 1
    Messages can be sent by other processes. – Hans Passant Nov 17 '11 at 16:46
  • Thanks, this helped me see the messages, although I still can't fix my other problem :( – Jordan Nov 17 '11 at 18:37

1 Answers1

0

Adding the user32.dll symbols from the MS symbol server helped. Thanks Werner.

Jordan
  • 9,014
  • 8
  • 37
  • 47