Solved

Dialog title

Posted on 1998-07-15
6
455 Views
Last Modified: 2013-11-20
How do I change the title of a dialog??
0
Comment
Question by:huya
  • 3
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 30 total points
ID: 1319256
SetWindowText
0
 
LVL 2

Expert Comment

by:VEngineer
ID: 1319257
A typical usage would be:

GetDlgItem(IDD_DIALOG_IDENTIFIER)->SetWindowText("New Dialog Title");

SetWindowText is a member function of class CWnd and can be used on any object, including dialogs (class CDialog) derived from CWnd.
0
 
LVL 7

Expert Comment

by:galkin
ID: 1319258
No, call SetWindowText for your dialog, not for control. It will set dialog title
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:huya
ID: 1319259
I have tried that... and at the point where I go to change the
title, the program crashes :

Sample code :  


CDoorDescript   doordescriptdlg(pDoc, &rearstruct, false);

doordescriptdlg.SetWindowText(CString("Hello"));

doordescriptdlg.DoModal();
0
 
LVL 7

Expert Comment

by:galkin
ID: 1319260
Your mistake is that you call SetWindowText BEFORe dialog is created so you program crahes. You must call this function from inside your dialog OnInitDialog.
0
 

Author Comment

by:huya
ID: 1319261
Thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 55
Expand data scrubbing tool 13 32
fix34  challenge 9 118
Problem to App 4 82
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

772 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