• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

How to disable the resize of SDI application

I want to disable the resize of a SDI application after creating it's window .  The develop environment is Visual C++ 4.1 under WIN95.
1 Solution
Hi here is what u need,
 Override the WM_SYSCOMMAND
 in that function
        if((nID == SC_MAXIMIZE) || (nID == SC_SIZE))
        CDialog::OnSysCommand(nID, lParam);

This will do.
thanx bye
To force the mainframe to a specific size, handle the message WM_GETMINMAXINFO. Modify ptMinTrackSize and ptMaxTrackSize in the MINMAXINFO struct passed to your message handler.

Ex: This will prevent the user from making the window smaller then 200 by 200:

void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
    lpMMI->ptMinTrackSize.x = 200;
    lpMMI->ptMinTrackSize.y = 200;
    // Pass to baseclass handler

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now