?
Solved

Dialog title

Posted on 1998-07-15
6
Medium Priority
?
491 Views
Last Modified: 2013-11-20
How do I change the title of a dialog??
0
Comment
Question by:huya
[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
  • 3
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 90 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

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