Here is the solution for the issue:
- switch(message)
- {
- case WM_SYSCOMMAND:
- {
- if(wParam == 0xf012 && IsZoomed() )
- {
- m_lPrevState = wParam;
- }
- else
- m_lPrevState = 0L;
- }
- break;
- case WM_MOVING:
- {
- if(IsZoomed())
- {
- LPRECT lprc;
- lprc = (LPRECT) lParam;
- lprc->right = m_iDlgWidth + lprc->left;
- lprc->bottom = m_iDlgHeight + lprc->top;
- }
- }
- break;
- case WM_WINDOWPOSCHANGING:
- if(m_lPrevState == 0xf012)
- {
- WINDOWPOS * lpwndpos;
- lpwndpos = (WINDOWPOS *)lParam;
- lpwndpos->cx = m_iDlgWidth;
- lpwndpos->cy = m_iDlgHeight;
- ShowWindow(SW_MAXIMIZE);
- }
- break;
- }
here,
m_iDlgWidth and
m_iDlgHeight specifies the maximum width and maximum height of the dialog.
with window can not be resized for the drag event on the title bar and at the same time it will be movable.