From an old post here
Quote Originally Posted by VladimirF
To track minimize / maximize events, you should handle WM_WINDOWPOSCHANGED message.
I would not worry about covering / uncovering of your window. Why? What if it is only partially covered? What if the top window is transparent?
I tried it but it didn't help.
Code:
void CMainFrame::OnWindowPosChanged(WINDOWPOS* lpwndpos)
{
	CFrameWnd::OnWindowPosChanged(lpwndpos);

	// TODO: Add your message handler code here
	if (lpwndpos->flags & SWP_SHOWWINDOW)
		AfxMessageBox(_T("Show"));
	else if (lpwndpos->flags & SWP_HIDEWINDOW)
		AfxMessageBox(_T("Hide"));
	
}
The control nevers come in this function, only at start time and exit time. I know one way is to check them in WM_SIZE but is that the only way? I just need to catch the events when window is maximized and restored.