In my MFC CFormView based application, i want to handle
ON_WM_NCLBUTTONDBLCLK()
windows message. ie, when a user double click on
Tittle bar of the dialog, window needs to be maximise. So i handled the above window message. To check whether clickked area is tittle bar or not iam used
HTCAPTION
. To maximise the dialog there is style called
SC_MAXIMIZE
. i know this. but iam not need this. so that iam used CWnd::MoveWindow function for resize the window.
But again double click is happend, then window needs to be restored.
For that iam handled
OnSysCommand( UINT nID_i, LPARAM lParam )
. ie iam send
::PostMessage( m_hWnd, WM_SYSCOMMAND, SC_RESTORE, 0 )
from double OnNcLButtonDblClk function. but Restore is not working.
handling of Restore.
void CTitleDoubleClickDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if( SC_RESTORE == nID )
{
CDialog::OnSysCommand(nID, lParam);
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
My question is
1. How to restore a window to its previous size by using SC_RESTORE( Note: iam using MoveWindow insted of SC_MAXIMISE for maximise the window)