I've made a dialog based mfc application and was wondering how I could change the caption of the dialog window.
If I goto properties on the dialog window it has id = IDD_SOCKET_DIALOG
Any help would be great
I've made a dialog based mfc application and was wondering how I could change the caption of the dialog window.
If I goto properties on the dialog window it has id = IDD_SOCKET_DIALOG
Any help would be great
In the MSVC environment you can simply right click on the dialog and select properties then type the caption you want it to have in the 'caption' box on the 'general' tab of the 'dialog properties' dialog box.
The other option is to do it programatically using the CWnd::SetWindowText() function.
Originally posted by LuckY
The other option is to do it programatically using the CWnd::SetWindowText() function.gives me "'CWnd::SetWindowTextA' : illegal call of non-static member function" What does that mean ?Code:CString name = "hello"; CWnd::SetWindowText(name);
Sorry yo. That's not how you use it. By writing CWnd::SetWindowText() I was just showing you that the function is a member of the CWnd class.
If you are calling the function from inside your dialog class (ie: class C...Dlg) you can just say:
To call it for another window, for example an edit box with id IDC_EDIT:Code:SetWindowText("Title");
For any window with a handle to it:Code:GetDlgItem(IDC_EDIT)->SetWindowText("Blah");
I'm sure this is too much information for you, but you seem very new to MSVC, and it will come into play eventually.Code:::SetWindowText(hwnd, "Stuff");
Thanks for your help.
Did the trick and yes, I started using msvc a about a week ago so Im rather new at itCode:SetWindowText("Title");