Hi, everyone
I'm using visual c++ with many dialog classes. I want to change the dialog title at runtime. I used the SetWindowText() to do that but it changes also the main window title and I don't want that. Has anyone another idea?
Printable View
Hi, everyone
I'm using visual c++ with many dialog classes. I want to change the dialog title at runtime. I used the SetWindowText() to do that but it changes also the main window title and I don't want that. Has anyone another idea?
Help!!!!!
SetWindowText is the right way, but you must call it for the appropriate window.
Show us your call and maybe we can spot the problem.
I'm calling the SetWindowText in OnInitDialog() like that:
if (litera == "E")
{
SetWindowText("Estimare");
// somecode
}
else
SetWindowText("Calcul TUI manual ");
Yes, that should change the title of the dialog on whose class you have that code.
Yes, but it changes also the main window dialog title. The main window caontains the menu and a map.
litera it's a char but seems to work ok because it changes the name the way I llike. What I don't like is that it changes the name of the main window, that with the menu.
I'm quite confused. Is it possible that you post a screenshot of the window?
I don't have a pointer hwnd for the dialog. I tried to use "this" but I've got a sintax error; using another pointer I've got " the dialog is already opened".
My application works like that: I have a main window which remanins on top, with the menu. From the menu I'm calling the dialogs. In OnUpdateMyDialog () the dialog is opened and go on with the code. The SetWindowText changes the name of the dialog but it changes also the name of the main window. That's my problem.
how can I do that? to add a jpeg?
what exactly do you want to see? the code is too large so....