?
Solved

How to disable the  resize of SDI application

Posted on 1998-12-17
2
Medium Priority
?
492 Views
Last Modified: 2013-11-20
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.
 
0
Comment
Question by:zqian103198
2 Comments
 
LVL 1

Accepted Solution

by:
arunprakash earned 150 total points
ID: 1326316
Hi here is what u need,
 Override the WM_SYSCOMMAND
 in that function
        if((nID == SC_MAXIMIZE) || (nID == SC_SIZE))
      return;
        CDialog::OnSysCommand(nID, lParam);

This will do.
thanx bye
0
 
LVL 4

Expert Comment

by:piano_boxer
ID: 1326317
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
    CMDIFrameWnd::OnGetMinMaxInfo(lpMMI);
}

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question