You need a handler for WM_SYSCOMMAND message. Maybe something like this:
void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
CFrameWnd::OnSysCommand(nID, lParam);
if (nID == SC\_MINIMIZE)
{
// Do your stuff here
// like maybe call ShowWindow(SW\_HIDE)
// or something?
}
}
Don't forget to add ON_WM_SYSCOMMAND() to the message map:). HTH, peter