Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changes to a Modal Dialog 2

Status
Not open for further replies.

HyperEngineer

Programmer
May 8, 2002
190
US
Hi,

I'm trying to change the window text and the text in a static text control on a modal dialog.
In order to make the changes I have to use the Create() member function, but this creates a modeless dialog.
If I use the DoModal() member function, I can't change the text.

Code:

CAboutDlg* aboutDialog = new CAboutDlg; // A
aboutDialog->Create(IDD_ABOUTBOX, this); // B
aboutDialog->SetWindowText("T1 NIU"); // C
aboutDialog->GetDlgItem(IDD_MESSAGE_TEXT)->SetWindowText("Action"); // D
aboutDialog->ShowWindow(SW_SHOW); // E
aboutDialog->DoModal(); // F

Either A,B,C,D,E or A,F but not A,B,C,D,E,F.

Any help on changing the text would be much appreciated.

Thanks,

Hyper

 
Just add a WM_INITDIALOG message handler for CAboutDlg and make all of your changes there.
 
Thanks Timmay,

It worked like a champ. Just what I was looking for.

Hyper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top