how to reset the mainframe title

Hello Guys,
In my SDI application when I open a document I set main frame tilte to my
own text using the following in CMyDoc::OnFileOpen():

CMainFrame* pFrame = (CMainFrame*)::AfxGetMainWnd();
pFrame->SetWindowText(MyOwnTitle);

Now when I open print preview and close it, coming back to my original view
I lose the frame title and it is initialized to standard MFC string
"untitled...". Can somebody telll me how I can preserve my own title or
where I can set it again when I am back from print preview window. Thanks in
advance.
Regards
Nemo


0
nemo7725 (5)
1/19/2006 8:53:05 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
386 Views

Similar Articles

[PageSpeed] 23

You should use CDocument::SetTitle(..) to set the tile instead of
CWnd::SetWindowText(..)

AliR.

"Nemo" <nemo@no_email.com> wrote in message news:dqou7h$krj$1@dns3.cae.ca...
> Hello Guys,
> In my SDI application when I open a document I set main frame tilte to my
> own text using the following in CMyDoc::OnFileOpen():
>
> CMainFrame* pFrame = (CMainFrame*)::AfxGetMainWnd();
> pFrame->SetWindowText(MyOwnTitle);
>
> Now when I open print preview and close it, coming back to my original
view
> I lose the frame title and it is initialized to standard MFC string
> "untitled...". Can somebody telll me how I can preserve my own title or
> where I can set it again when I am back from print preview window. Thanks
in
> advance.
> Regards
> Nemo
>
>


0
AliR3470 (3236)
1/19/2006 9:24:46 PM
In additional to Ali's answer you may want to add this to the 
PreCreateWindow() or OnCreate() function to keep it from displaying the 
document name in the title as well:

cs.style &= ~FWS_ADDTOTITLE;

Here is some interesting info:

http://simplesamples.info/MFC/ChangeTitle.php

Tom


"Nemo" <nemo@no_email.com> wrote in message news:dqou7h$krj$1@dns3.cae.ca...
> Hello Guys,
> In my SDI application when I open a document I set main frame tilte to my
> own text using the following in CMyDoc::OnFileOpen():
>
> CMainFrame* pFrame = (CMainFrame*)::AfxGetMainWnd();
> pFrame->SetWindowText(MyOwnTitle);
>
> Now when I open print preview and close it, coming back to my original 
> view
> I lose the frame title and it is initialized to standard MFC string
> "untitled...". Can somebody telll me how I can preserve my own title or
> where I can set it again when I am back from print preview window. Thanks 
> in
> advance.
> Regards
> Nemo
>
> 


0
tserface (3861)
1/19/2006 10:02:23 PM
Perfect, Thanks guys, that helped.


"Tom Serface" <tserface@msn.com> wrote in message
news:%23M5MIQUHGHA.312@TK2MSFTNGP09.phx.gbl...
> In additional to Ali's answer you may want to add this to the
> PreCreateWindow() or OnCreate() function to keep it from displaying the
> document name in the title as well:
>
> cs.style &= ~FWS_ADDTOTITLE;
>
> Here is some interesting info:
>
> http://simplesamples.info/MFC/ChangeTitle.php
>
> Tom
>
>
> "Nemo" <nemo@no_email.com> wrote in message
news:dqou7h$krj$1@dns3.cae.ca...
> > Hello Guys,
> > In my SDI application when I open a document I set main frame tilte to
my
> > own text using the following in CMyDoc::OnFileOpen():
> >
> > CMainFrame* pFrame = (CMainFrame*)::AfxGetMainWnd();
> > pFrame->SetWindowText(MyOwnTitle);
> >
> > Now when I open print preview and close it, coming back to my original
> > view
> > I lose the frame title and it is initialized to standard MFC string
> > "untitled...". Can somebody telll me how I can preserve my own title or
> > where I can set it again when I am back from print preview window.
Thanks
> > in
> > advance.
> > Regards
> > Nemo
> >
> >
>
>


0
nemo7725 (5)
1/19/2006 10:55:44 PM
Thanks Guys, That helped.


"Nemo" <nemo@no_email.com> wrote in message news:dqou7h$krj$1@dns3.cae.ca...
> Hello Guys,
> In my SDI application when I open a document I set main frame tilte to my
> own text using the following in CMyDoc::OnFileOpen():
>
> CMainFrame* pFrame = (CMainFrame*)::AfxGetMainWnd();
> pFrame->SetWindowText(MyOwnTitle);
>
> Now when I open print preview and close it, coming back to my original
view
> I lose the frame title and it is initialized to standard MFC string
> "untitled...". Can somebody telll me how I can preserve my own title or
> where I can set it again when I am back from print preview window. Thanks
in
> advance.
> Regards
> Nemo
>
>


0
nemo7725 (5)
1/19/2006 10:58:48 PM
Reply:

Similar Artilces:

Will reseting workflow lose processes?
We have several rules that have wait statements hence we may have dozens (or more) of processes that are active and waiting. If I need to reset IIS and workflow to add a new custom assembly, will we loose any of those processes that are waiting or will they pick right back up when workflow restarts? Thanks for any answers. Greg they will continue on...restarting IIS and the workflow service will not reset or stop the workflows ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "gstat" <gsergeant@statsoft.com> wrote in mess...

Titles and bodies in Outlook
Is there any way to make outlook donwload only the titles of the email massages and after at the user request to download the body? asantos@jardine.pt <anonymous@discussions.microsoft.com> wrote: > Is there any way to make outlook donwload only the titles > of the email massages and after at the user request to > download the body? What version of Outlook? -- Brian Tillman ...

Newgroups Reseting List
When I try to reset my news group list it goes to almost 30,000 and then the program stops responding. Must shut down and restart explorer. Any suggestions? Thanks, Gordon Outlook doesn't provide NNTP (network news transfer protocol) support. Neither does Explorer. Neither does *Internet* Explorer, which is maybe what you meant. You use Outlook Express for that (Outlook and IE can call it or you can load OE yourself). [Internet] Explorer is not an NNTP client so I don't know why you are restarting it. If you are using Outlook Express, repost your question in a newsgroup that d...

Don't reset the counter
I have a form and a subform. The user has to respond to each line on the subform. After completing all of the lines the user clicks on a button on the main form to run a bunch of code to complete the process. I would like to be able to check to make sure that the user has in fact responded to all of the questions on the subform when the click the complete button. I set up an unbounded field in the main form to count all of the responses. The problem is, sometimes users won't complete all of the responses right away. Some today and some tomorrow. How can I set my counter to kno...

Reset User Password
How do you reset a user's password in GP 10.0? Jessica, Log in as 'sa' or DYNSA and go to Microsoft Dynamics GP > Tools > Setup > System > User. Lookup the user ID in question and: 1) Replace the password in the window with say for example, password 2) In the Advanced SQL Server options, chose Enforce Password Policy, and select Change Password Next Login. Once the user change their password, you can go back into this window and disable the Enforce Password Policy option for that particular user. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Globa...

How to reset and reinstall default websites (RWW,OWA,OMA,etc..)
I have some problems on a SBS2003 R2 Standard Edition that I need to manage. I want to enable to users OWA and RWW but trying to connect at websites I receive an error from IE : "Unable to connect to page" (url:res://ieframe.dll/dnserrordiagoff.htm#) Only "companyweb" work. Thinking at some dns issue, I tried to connect using the numerical ip (http://192.168.1.250/exchange) without results. Considered that the internal websites (companyweb included) was never used, is there a way to reset all and to restore the original configuration ? Thank you for sup...

Adding Edit Control to MainFrame.
I'm trying to add an Edit Control to MainFrame. I'm creating an instance of CEdit in the paint message like this: void SAFrame::OnPaint() { CFrameWnd::OnPaint(); CEdit *PEdit = new CEdit; PEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 50, 150, 70), this, 0x1552); } But the control is not displayed. I think you have better ideas. -- Saint Atique [Novice MFC Programmer] "Saint Atique" <unix9n@gmail.com> wrote in message news:1db59444-17d4-4bc1-bc7a-1adcf3b75b9b@v8g2000vbh.googlegroups.com...

trace listener
Hi, I'm trying to write trace out using TextWriterTraceListener. It work fine. But I would like to do the following 2 tasks but I can't find any way to do it. - Limit maximum log file size - Refresh log file content everytime program start. thank you very much, Bandu Bandu wrote: > Hi, > > I'm trying to write trace out using TextWriterTraceListener. It work > fine. But I would like to do the following 2 tasks but I can't find > any way to do it. > > - Limit maximum log file size > - Refresh log file content everytime program st...

Resetting cells to zero value.
I have lots of cells with numbers. Can I place a button that will reset all cells to zero? Right now, when I want to start over, I go to each cell and change it to zero. I have 250 cells. Thank you if you can help with this. Select the 250 cells you want to reset to 0. Hit alt-f11 to get to the VBE hit ctrl-g to see the immediate window Type this: Selection.name = "ClearThemAll" and hit enter Now back to excel select any cell. Start recording a macro. Hit F5 type: ClearThemAll hit enter type 0 hit ctrl-enter (to fill all the selected cells with 0) stop recording the macro (or s...

Sorting titles for a mail out
Hello I haven't used excel for over ten years and have been asked to amend database of names and addresses for somebody and then sort them so h can do mail outs. Sometimes eg column a) will be Mr Smith, so letter will say Dear M Smith. Pips. But sometimes column a) will be The Marketing Manager. This is grea for the address label, but I want to say Dear Future Exhibitor in th letter. Do you know how I do this please? thanks, Paul -- Lance ----------------------------------------------------------------------- LanceB's Profile: http://www.excelforum.com/member.php?action=getinfo&...

reset autonumber question
How do you reset an autonumber field to 1? Thanks. Delete all records. Compact the database. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. " 00ScarlettJohnson" <EE@yahoo.com> wrote in message news:OuB6qgYfHHA.2640@TK2MSFTNGP06.phx.gbl... > How do you reset an autonumber field to 1? Thanks. ...

Importing music titles into a spreadsheet
I use a spreadsheet with macros that lists all the file names of my songs from my music folder into an excel spreadsheet ( I can post ir if it will help). My new comupter has Office 2007 and the macro will not work. I do not know macros well enough to fix it. Does anyone know of a spreadsheet I can dowmload that would look into a folder and copy the file names into an execl spreadsheet? Thanks you for your help, Russ Several methods to accomplish this.......I like Tushar's best if importing to Excel. To add a "Print Directory" feature to Explorer, go to this KB Artic...

Reset page number on invoice forms
All, I am running Access via Office XP Pro on Windows 7. Background: I am working on an invoice "form" report. (By form I mean the actual form that I will hand the customer versus an data entry form.) I have it pretty much working thanks to different members on this form, but I have another question. For this report Work Order number is also used as the invoice number. The report is comprised of the following parts: Main report: row source is qrytblWorkOrder table (Invoice rcd) WorkOrder Header - Grouped by Work Order / Inv No # Detail Page...

IE8 Title bug
According to Microsoft Connect (https://connect.microsoft.com/IE) I should report a possible bug in this newsgroup. When I want to save a webpage I sometimes get the message "This webpage could not be saved". I discovered that this was caused by the 'title' tag of the html document. It seems that the error message is shown whenever the 'title' tag exceeds 259 characters. I use Windows Vista Ultimate 64-bits and tested IE 8.0.6001.18828 both 32-bits and 64-bits version. ---------------- This post is a suggestion for Microsoft, and Microsoft respon...

How to route a message from MainFrame to Doc and View?
Hello everyone, I am working on an SDI application called Test. In the CTestApp::InitInstance() I create a worker thread to which I pass the HWND of the application (*m_pMainWnd) and the message ID. In the worker thread, when I post a message using PostMessage() to the main window, I can only catch it in the MainFrame. I tryied to catch it in the TestDoc or in the TestView without succeeding. From my understanding, whenever the MainFrame receives a message it routes it to the documents and views, if it didn't handle it! 1. How could I route the received message in the MainFrame to ...

mainframe title bar
In my SDI app, is it possible to change the text in the title bar at any point after startup? >In my SDI app, is it possible to change the text in the title bar at any >point after startup? Steve, You can change the caption using SetWindowText, however the MFC doc/view arrangement normally sets the caption for you. To prevent it doing this, remove the FWS_ADDTOTITLE style. Have a look at the MSDN topic titled "Changing the Styles of a Window Created by MFC" for more information. Dave -- MVP VC++ FAQ: http://www.mvps.org/vcfaq Thank you. I currently do alter the cap...

OptionButton. Reset to 0
Readers, Can OptionButtons be set to 0, using something like For each - Next ?? Up till now I know no better way then Me.OptionButton1 = 0 Me.OptionButton2 = 0 Me.OptionButton3 = 0 Me.OptionButton4 = 0 Thanks, Eef try this one: Me.OptionButton1.Value = True pls do rate "Eef Houniet" wrote: > Readers, > > Can OptionButtons be set to 0, using something like For each - Next ?? > > Up till now I know no better way then > > Me.OptionButton1 = 0 > Me.OptionButton2 = 0 > Me.OptionButton3 = 0 > Me.OptionButton4 = 0 > > Thanks, >...

Outlook 2002 password reset!
I have an employee that left a few days ago. His Outlook 2002 has a .pst folder password that I don't know. He did not leave on good grounds and will not provide that password. I need to access his e-mails and contacts. How can I work around this problem? Thanks! Depends on what kind of Email system he's used. If he had a private account online,... lets say through his own web-hosting provider, then there is no way to get his password. The only other thing I can think of is to go to this site and see if the instructions will help you erase his old passwords, etc... ht...

Canadian Payroll YEAR END FILE RESET
Is there an impact to procede with the YEAR END FILE RESET before installing the 2006 TAX TABLES? I don't think so. If memory serves, we usually roll into the new year before the tax tables updates are available, as is the case this year. Martin wrote: > Is there an impact to procede with the YEAR END FILE RESET before installing > the 2006 TAX TABLES? > > ------=_NextPart_0001_09529574 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Martin, This is Terry. I can help with your Year End question. It is not recommend to complete the year end process be...

Reset Pop-Up Blocker on Template Form
I have edited the design of the Contacts Template form. How do I reset the tab order to start with the new text boxes I have entered? In Design View I selected all of the text boxes, selected Tab Order, and for the template only tabContacts appears for the Tab Order. The new items I added are on the list, but in order to make the form work, I had to move them to the top. When I return to form view, select Save and New, the tab goes to my new tab "Category1" then "CategoryII", then it goes to "General". If I hit the tab again it goes to "Title", an...

title
How can I get my first line or title line to appear on top of all pages? In the File menu go into Page Setup, then click on the Sheet tab. In Print Titles select the row you want to repeat. Key in 1:1 if you want the first row. 2:2 for second row. 1:2 for first and second row. -- Regards, Martin "lbierer" wrote: > How can I get my first line or title line to appear on top of all pages? lbierer wrote: > How can I get my first line or title line to appear on top of all pages? File> Page setup > Sheet look for rows to repeat at the top. Click in that box the click o...

graphs
Hello, don't know if anyone can help but... I am working on creating KPI's and I have one for which the graph was already generated from the spreadsheet (sorry if my excel jargon is off - I work in France and know this better in French than English!). The Y axis exists and has a title and I would like to create the axis with a title and numbers on the opposite Y axis. Dunno how to do that even with my Idiot's guide to Excel. Would much appreciate it if anyone could advise me. Thanks! Velvet -- Velvet ------------------------------------------------------------------------ V...

Printing row titles each page
Using the tutorial when it comes to printing row titles on each page, I do not know what to put in under the "Printing Titles". I assume it was the row number (1) but that does not work. What do you put in to print titles on several pages. Thank you.. ...

How to set the title of a MDI child window?
I want to do this by calling SetWindowText(). But I think it is not a best way. Could you give me any suggestions? Thank you. Mizi: If you are using the Document/View, call the following from your view: GetDocument()->SetTitle("My Window Title"); Nithi Gurusamy "mizi" <all@ywzc.net> wrote in message news:Xns9416E1873F02Fallywzcnet@207.46.248.16... > I want to do this by calling SetWindowText(). But I think it is not a best > way. Could you give me any suggestions? Thank you. ...

KB article 275171 How to reset System Folders in Exchange 2000
I have an error message that occurs when an user tries to download the offline address book, and the only fix I have found is the above KB article; however, I am reluctant to run it on a production Exchange server without knowing what affect resetting the system folders will have on the end users' data in both public folders and mailboxes. Has anyone used this tool, and done this procedure? If so, do I have anything to worry about or is it a no brainer? Thanks. Hi, Resetting system folders will not affect mailboxes. It will, however, clear out all of the schedule + free /buys data...