Changing the caption on a modal dialog
I have tried to change the caption for a modal dialog with this code:
CMyDia dlg;
dlg.SetWindowsText("Hello World");
dlg.DoModal();
The code compiles and runs but the caption will not change. The CMyDia class is just a dialog with a static text. The class is created by ClassWizard.
The code is in a dll.
//Anders
Re: Changing the caption on a modal dialog
Call dlg.SetWindowsText("Hello World"); in dlg.OnInitDialog.
Sincerely, Mihai
Re: Changing the caption on a modal dialog
When you call SetWindowTExt() it will try to change the caption of an existing window. In the dialog case, window is created only when you call DoModal(). Till that time window doesn't exist, so calling SetWindowText() before DoModal() won't make any change. You do it in the InitDialog().
[email protected]
B'lore
India.