Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to catch the MINIMIZE event for CDialog

Status
Not open for further replies.

d00ape

Programmer
Apr 2, 2003
171
SE
I would like to override the minimize-event so that the dialog remains where it is but resizes to a fixed size (e.g. CRect( x, y, 320, 100 ) )

How is that possible?

I’ve tried this but don’t get the ” CRect( x, y, 320, 100 )”-size

void CDlg::OnSize(UINT nType, int cx, int cy){
if( nType == SIZE_MINIMIZED )
{
CPoint p;
GetCursorPos( &p );
SetWindowPos( 0, p.x, p.y, 320, 100, 0 )
return;
}



}


APe
 
try to override WndProc

Ion Filipski
1c.bmp
 
OK! I made it up like this:

void CTabDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if( nID == SC_MINIMIZE )
{
CRect p;
GetWindowRect( &p );
SetWindowPos( 0,p.left,p.top,m_width,m_minheight,0 );
return;
}
CDialog::OnSysCommand(nID, lParam);
}

APe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top