Application Title in MDI Application
-
From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime? Here's what i want to do: Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1" How do i change it so that it doesn't change back?
-
From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime? Here's what i want to do: Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1" How do i change it so that it doesn't change back?
eusto wrote:
the mainframe title is stored in the string table.
CDocument::SetTitle
. Read the docs too.
Nibu thomas A Developer Programming tips[^] My site[^]
-
eusto wrote:
the mainframe title is stored in the string table.
CDocument::SetTitle
. Read the docs too.
Nibu thomas A Developer Programming tips[^] My site[^]
-
I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
eusto wrote:
I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
That's how it's to be done in DV architecture. If you want to force a different behavior override
UpdateFrameTitleForDocument
which again is not a virtual function. You would like to look upFWS_ADDTOTITLE
andFWS_PREFIXTITLE
.
Nibu thomas A Developer Programming tips[^] My site[^]
-
eusto wrote:
I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
That's how it's to be done in DV architecture. If you want to force a different behavior override
UpdateFrameTitleForDocument
which again is not a virtual function. You would like to look upFWS_ADDTOTITLE
andFWS_PREFIXTITLE
.
Nibu thomas A Developer Programming tips[^] My site[^]
Nibu babu thomas wrote:
If you want to force a different behavior override UpdateFrameTitleForDocument which again is not a virtual function.
If its not virtual, how different behaviour can be forced ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
eusto wrote:
I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
One line of code is too much. :confused: How so?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
From what i've understood, the mainframe title is stored in the string table. How can i change it at runtime? Here's what i want to do: Let's say the application title is MyApp. For some reasons it becomes MyApp USERID. Doing this for the main window is easy with setwindowtext, but when i open a document it switches back to MyApp and the title switches from "MyApp USERID" to "My App - Document1" How do i change it so that it doesn't change back?
Override
CFrameWnd::OnUpdateFrameTitle()
. The application framework calls this method whenever it needs to update the frame's caption. On-demand updating is preferred to setting a modified title. (Why? Because it reduces the chance of programmer error and centralizes the title logic to a single location.) /raviThis is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com
-
I was talking about the main window title. I would have to use CDocument::SetTitle() for every document that i open and...that's a bit too much
AfxGetMainWnd()->SetWindowText("My Title");
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001