-
November 17th, 2009, 04:46 AM
#1
change the dilog title at runtime
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?
-
November 17th, 2009, 04:48 AM
#2
Re: change the dilog title at runtime
-
November 17th, 2009, 04:48 AM
#3
Re: change the dilog title at runtime
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.
-
November 17th, 2009, 04:50 AM
#4
Re: change the dilog title at runtime
Originally Posted by florivucu
Help!!!!!
Don't be childish, have patience for people to answer. We are doing voluntary help here and you should keep that in mind. Don't expect that your questions are answered in 2 minutes.
-
November 17th, 2009, 04:51 AM
#5
Re: change the dilog title at runtime
I'm calling the SetWindowText in OnInitDialog() like that:
if (litera == "E")
{
SetWindowText("Estimare");
// somecode
}
else
SetWindowText("Calcul TUI manual ");
-
November 17th, 2009, 04:53 AM
#6
Re: change the dilog title at runtime
Yes, that should change the title of the dialog on whose class you have that code.
-
November 17th, 2009, 04:59 AM
#7
Re: change the dilog title at runtime
Yes, but it changes also the main window dialog title. The main window caontains the menu and a map.
-
November 17th, 2009, 05:01 AM
#8
Re: change the dilog title at runtime
Originally Posted by florivucu
I'm calling the SetWindowText in OnInitDialog() like that:
That line seems wrong.
What is litera? Is it a char? If yes - then you should use apostrophes:If it is char array (or char*) then use strcmp function
Victor Nijegorodov
-
November 17th, 2009, 05:06 AM
#9
Re: change the dilog title at runtime
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.
-
November 17th, 2009, 05:13 AM
#10
Re: change the dilog title at runtime
Originally Posted by florivucu
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.
pass the windows handle of appropriate window.Like this
Code:
::SetWindowText(hwnd,"Run Time change");
-
November 17th, 2009, 05:25 AM
#11
Re: change the dilog title at runtime
I'm quite confused. Is it possible that you post a screenshot of the window?
-
November 17th, 2009, 05:28 AM
#12
Re: change the dilog title at runtime
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.
-
November 17th, 2009, 05:34 AM
#13
Re: change the dilog title at runtime
how can I do that? to add a jpeg?
-
November 17th, 2009, 05:35 AM
#14
Re: change the dilog title at runtime
Originally Posted by florivucu
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.
ok can you show here code?
-
November 17th, 2009, 05:37 AM
#15
Re: change the dilog title at runtime
what exactly do you want to see? the code is too large so....
Tags for this Thread
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
|