|
-
May 8th, 1999, 05:07 PM
#1
Minimized Window
Is there a way to trap a application being minimized (WM_MINIMIZED???)?
Thanks!
-
May 8th, 1999, 07:44 PM
#2
Re: Minimized Window
You need to overload the OnSysCommand handler in your window class. However since the WM_SYSCOMMAND is not an option in class wizard so you'll need to add it by hand.
First add
afx_msg void OnSysCommand( UINT nID, LPARAM lParam );
before the DECLARE_MESSAGE_MAP() call in your class definition
then add
ON_WM_SYSCOMMAND()
between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP in the classes .cpp file
then add the OnSysCommand() handler to the. cpp file like so...
void CMainFrame::OnSysCommand( UINT nID, LPARAM lParam ){
if (nID == SC_MINIMIZE){
// Process minimize message here
}
else
CFrameWnd::OnSysCommand(nID, lParam);
}
Good Luck!!!
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
|