?
Solved

Disable the close button on a dialog box

Posted on 2003-03-28
6
Medium Priority
?
248 Views
Last Modified: 2013-11-20
I would like to know how we can disable the close button ( X ) on a dialog box.

NeoMind
0
Comment
Question by:NeoMind
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:abdo81
ID: 8227721
Hi
Add this function
void CMyDlg::OnClose()
{
     return;
}
Bye
0
 
LVL 2

Accepted Solution

by:
manojbkumar earned 100 total points
ID: 8229274
In OnInitDilaog() add the follwing code

CMenu* pSysMenu = GetSystemMenu(FALSE);
     if (pSysMenu != NULL)
     {
          pSysMenu->RemoveMenu(SC_CLOSE,MF_BYCOMMAND);
     }
0
 
LVL 3

Assisted Solution

by:aphillips
aphillips earned 100 total points
ID: 8230248
Simply unchecking "System menu" on page 2 of the Dialog Properties in the dialog editor removes the checkbox.  This also removes minimize and maximize but very few dialogs have those.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

770 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