MFC:捕获调整大小
只是想知道在调整整个窗口大小时触发的 MFC 应用程序中最好将功能放在哪里。 我在想 mainfrm 但我似乎无法捕获任何 OnSize 消息...
有人可以告诉我我做错了什么吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您没有包含任何有趣的细节,因此这里有一些猜测(因为当然主机通常会发送
WM_SIZE
消息...):WM_WINDOWPOSCHANGED
的处理程序,该处理程序无法调用默认窗口过程,从而阻止发送WM_SIZE
消息。You didn't include any interesting details, so here are a few guesses (because of course the mainframe normally gets sent
WM_SIZE
messages...):WM_WINDOWPOSCHANGED
that fails to call the default window procedure, thereby preventingWM_SIZE
messages from being sent.我猜测您正在使用多文档界面(MDI)应用程序类型。 在这种情况下,您应该在每个视图(从 CView 派生的类)中捕获 WM_SIZE 消息。
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.