Click to See Complete Forum and Search --> : MFC Dialog: How to add a minimize/maximize button into your dialog?


Brad Jones
February 13th, 2003, 12:39 PM
Q: How to add a minimize/maximize button into your dialog?

A:

At design time: use the dialogs properties in the resource editor.
At runtime: override the 'OnCreate()' function like this:



int CYourDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CDialog::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
SetWindowLong(this->m_hWnd,
GWL_STYLE,
GetWindowLong(this->m_hWnd, GWL_STYLE) | WS_MINIMIZEBOX | WS_MAXIMIZEBOX);

return 0;
}

<br><br>