We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Dialog title

huya
huya asked
on
Medium Priority
512 Views
Last Modified: 2013-11-20
How do I change the title of a dialog??
Comment
Watch Question

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
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.

Commented:
No, call SetWindowText for your dialog, not for control. It will set dialog title

Author

Commented:
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();

Commented:
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.

Author

Commented:
Thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.