|
-
December 27th, 2007, 12:44 AM
#3
Re: how to track minimize, maximize events
Hello,
Maximizing / minimizing window can be done only by using buttons on the toolbar or by toolbar menu. One can check for the corresponding messages for the window concerned and take appropriate actions.
Whether window is being maximized / minimized can be known if we store the previous window state. If you modify the PreTranslateMessage function to some thing as shown below, you can trap the maximizing event in a simplified way.
Code:
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
static int State = 0;
BOOL Flag = CFrameWnd::PreTranslateMessage(pMsg);
if ((State == SW_SHOWMAXIMIZED) != IsZoomed())
// Window is getting zoomed
...
State = SW_SHOWMAXIMIZED;
return Flag;
}
Regards,
Pravin.
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
|