views:

133

answers:

2

Just wondering where is best to put functionality in an MFC application that is triggered when the whole window is resized. I was thinking mainfrm but I couldn't seem to capture any OnSize messages...

Can someone tell me what I am doing wrong?

+1  A: 

I am guessing that you are using the Multiple Document Interface ( MDI ) application type. In this case, you should capture the WM_SIZE message in each of your views - the classes you have derived from CView.

ravenspoint
+2  A: 

Can someone tell me what I am doing wrong?

You didn't include any interesting details, so here are a few guesses (because of course the mainframe normally gets sent WM_SIZE messages...):

  • You didn't set up your message handler properly. Perhaps you forgot the message map entry?
  • You have an existing handler in place for WM_WINDOWPOSCHANGED that fails to call the default window procedure, thereby preventing WM_SIZE messages from being sent.
Shog9
Yep, I was trying to catch ON_SIZE rather than WM_SIZE. Thanks for the tip. Thanks!
Konrad