|
-
March 22nd, 2004, 04:05 AM
#1
Set Caption
Can you tell me how to set from code a window dialog caption?
I have tried to use GetDlgItem to get the reference of the window and SetWindowText to set the string but it gives me an error.
-
March 22nd, 2004, 04:18 AM
#2
The question is rather unclear here, from things it seems that you donot have a pointer to your dialog instance.... is it so??
if yes ...
I doubt the use of GetDlgItem for finding something in a window, but the case here is that u are on a lookout for the dialog itself, wouldnt it be strange to use GetDlgItem() for finding a dialog.
Use EnumChildWindows() and find the dialog if you donot have the reference to the dialog. winth any matching criteria like the class name or anyother property.
otherwise clear the question by elaborating a little, also give the error information.
cheers
-
March 22nd, 2004, 04:33 AM
#3
Excuse me you're right
CWnd *a;
a=m_pDlg->GetDlgItem(IDD_MYWINDOW);
a->SetWindowText("some text");
Where m_pDlg is a pointer at my dialog class
The error is "Memory could not be read "
-
March 22nd, 2004, 04:39 AM
#4
what's IDD_MYWINDOW? Your dialog ID?
m_pDlg->SetWindowText("some text");
Best Api Monitor tool.
Trace the target program automatically and monitor the parameters of all API and COM interfaces.
Auto Debug for Windows 4.0
Auto Debug for .Net
http://www.autodebug.com/
-
March 22nd, 2004, 04:46 AM
#5
Yes.
I have used this code because for other controls(static texts,buttons etc),it works and I manage to set caption.
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
|