|
-
May 11th, 1999, 07:18 AM
#1
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
-
May 11th, 1999, 07:34 AM
#2
Re: Changing the caption on a modal dialog
Call dlg.SetWindowsText("Hello World"); in dlg.OnInitDialog.
Sincerely, Mihai
-
May 11th, 1999, 08:39 AM
#3
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|