Konrad
Konrad

Reputation: 40937

MFC: Capturing Resizes

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?

Upvotes: 0

Views: 1638

Answers (2)

Shog9
Shog9

Reputation: 159590

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.

Upvotes: 2

ravenspoint
ravenspoint

Reputation: 20457

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.

Upvotes: 1

Related Questions