mainframe title bar

In my SDI app, is it possible to change the text in the title bar at any 
point after startup? 


0
srussell2458 (497)
1/16/2005 9:58:54 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
1144 Views

Similar Articles

[PageSpeed] 36

>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
0
davidl7375 (2060)
1/16/2005 10:34:48 PM
Thank you.  I currently do alter the caption in 
CMainFrame::PreCreateWindow(), but I am wondering if I can make further 
changes at various points in the running of the program.
--------------------
"David Lowndes" <davidl@example.invalid> wrote in message 
news:drqlu053ggmdmkf246pkcjs4e3vr1u45s0@4ax.com...
> >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 


0
srussell2458 (497)
1/16/2005 10:48:19 PM
Steve Russell wrote:
> Thank you.  I currently do alter the caption in 
> CMainFrame::PreCreateWindow(), but I am wondering if I can make further 
> changes at various points in the running of the program.

If you remove the FWS_ADDTOTITLE style in PreCreateWindow then you can 
set the titlebar to anything you want any time you want by Calling 
SetWindowText.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
1/16/2005 10:59:24 PM
Wonder what I'm not understanding here. . . .

In CMainFrame::PreCreateWindow(), I do this:

cs.style &= ~FWS_ADDTOTITLE; // remove "untitled" from caption

and in my view I do this:

SetWindowText("testing");

with no results.
------------------
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message 
news:OA48G%23B$EHA.2804@TK2MSFTNGP15.phx.gbl...
> Steve Russell wrote:
>> Thank you.  I currently do alter the caption in 
>> CMainFrame::PreCreateWindow(), but I am wondering if I can make further 
>> changes at various points in the running of the program.
>
> If you remove the FWS_ADDTOTITLE style in PreCreateWindow then you can set 
> the titlebar to anything you want any time you want by Calling 
> SetWindowText.
>
> -- 
> Scott McPhillips [VC++ MVP]
> 


0
srussell2458 (497)
1/17/2005 12:23:31 AM
I just realized -- my problem must be that I am trying to do this in the 
view, instead of the main window.  If this is correct, now I have to 
remember how get a pointer to the mainframe.
---------------
"Steve Russell" <srussell@removethisinnernet.net> wrote in message 
news:OLogFrC$EHA.2804@TK2MSFTNGP15.phx.gbl...
> Wonder what I'm not understanding here. . . .
>
> In CMainFrame::PreCreateWindow(), I do this:
>
> cs.style &= ~FWS_ADDTOTITLE; // remove "untitled" from caption
>
> and in my view I do this:
>
> SetWindowText("testing");
>
> with no results.
> ------------------
> "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message 
> news:OA48G%23B$EHA.2804@TK2MSFTNGP15.phx.gbl...
>> Steve Russell wrote:
>>> Thank you.  I currently do alter the caption in 
>>> CMainFrame::PreCreateWindow(), but I am wondering if I can make further 
>>> changes at various points in the running of the program.
>>
>> If you remove the FWS_ADDTOTITLE style in PreCreateWindow then you can 
>> set the titlebar to anything you want any time you want by Calling 
>> SetWindowText.
>>
>> -- 
>> Scott McPhillips [VC++ MVP]
>>
>
> 


0
srussell2458 (497)
1/17/2005 12:26:44 AM
I am getting results with this now:

CFrameWnd* pframe = (CFrameWnd*) AfxGetMainWnd();
pframe ->SetWindowText("testing");

Anything wrong with this method?  Thanks for the help.
-------------
"Steve Russell" <srussell@removethisinnernet.net> wrote in message 
news:%23Zh74sC$EHA.612@TK2MSFTNGP09.phx.gbl...
>I just realized -- my problem must be that I am trying to do this in the 
>view, instead of the main window.  If this is correct, now I have to 
>remember how get a pointer to the mainframe.
> ---------------
> "Steve Russell" <srussell@removethisinnernet.net> wrote in message 
> news:OLogFrC$EHA.2804@TK2MSFTNGP15.phx.gbl...
>> Wonder what I'm not understanding here. . . .
>>
>> In CMainFrame::PreCreateWindow(), I do this:
>>
>> cs.style &= ~FWS_ADDTOTITLE; // remove "untitled" from caption
>>
>> and in my view I do this:
>>
>> SetWindowText("testing");
>>
>> with no results.
>> ------------------
>> "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message 
>> news:OA48G%23B$EHA.2804@TK2MSFTNGP15.phx.gbl...
>>> Steve Russell wrote:
>>>> Thank you.  I currently do alter the caption in 
>>>> CMainFrame::PreCreateWindow(), but I am wondering if I can make further 
>>>> changes at various points in the running of the program.
>>>
>>> If you remove the FWS_ADDTOTITLE style in PreCreateWindow then you can 
>>> set the titlebar to anything you want any time you want by Calling 
>>> SetWindowText.
>>>
>>> -- 
>>> Scott McPhillips [VC++ MVP]
>>>
>>
>>
>
> 


0
srussell2458 (497)
1/17/2005 12:34:40 AM
Reply:

Similar Artilces:

Scroll Bar on Forms
I am using tab controls to move through my forms. When the form opens, the right scroll bar is not at the top, but a little ways down. This prevents the tabs from being seen, without moving the scroll bar to the top. I am using a Form Header and a detail section. How can I make sure the scroll bar on the right, stays at the top upon opening the form. Thanks In your form's Load event, SetFocus to a control that can receive the focus and will result in your form being scrolled to the proper location, -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please re...

range bar chart
Hi, can anyone help me with creating a range bar chart like the one shown in this website. http://www.ncsu.edu/labwrite/res/gh/gh-bargraph.html#rangebar Thanks Hi, Have a look at the Gantt chart links. http://www.peltiertech.com/Excel/Charts/ChartIndex.html#G Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "conkerbuyore" <conkerbuyore@discussions.microsoft.com> wrote in message news:1BE6D805-9B7C-4BB9-AAE2-A4AD8749C0C3@microsoft.com... > Hi, can anyone help me with creating a range bar chart like the one shown > in > this website. &...

How to enable the language bar
I wish to show the language bar on my desktop but when I look at the Regioanl and Language Options in the control panel, then choose the Languages tab and select Details, the language bar preferences are disabled. Any idea how I can get the bar to show on my desktop? The Language bar is displayed automatically if you install a text service such as handwriting, speech, or an Input Method Editor (IME). However, if you close the Language bar, you can use this procedure to redisplay it. HOW TO: Use the Language Bar in Windows XP http://support.microsoft.com/default.aspx/kb/306993 ...

Bar and Line chart #2
I am using Excell 2003 I need to create a BAR graph with 3 years of Sales $$ (1 being the current year) and add to that a LINE that shows the BUDGETED $$ for the current year. From the Chart Wizard I chose the "line - column" chart because both the bars and the line are all using the same $$ numbers. Sales $$ for 2006 and 2007 came up as Bars but Sales for 2008 came up as a line along with the budget $$ being a line also. I now have a graph of 2 bars and 2 lines. I wanted 3 bars and 1 line. How do I get all 3 years of Sales to be bars and only the Budgeted Sales to be th...

Changing title of a property sheet
I have a property sheet (actually a wizard) that can do multiple tasks (Restore/Compare/Verify). I want to change the title of each page to reflect the task the sheet has been invoked for. Whatever I do though, the titles remain unchanged. I have set the dialog templates with a placeholder in the title string, eg "??? Wizard - Welcome". I want to replace "???" on each page with either "Restore", "Compare" or "Verify". I can retrieve the title (using GetWindowText()) into a CString and replace the marker in the CString. I can then do SetWindowT...

Getting menu handle from a floating menu bar
Hi All, I am launching many applications from my application in background. Say I launched MS Word. Now, I want the handle of the launched application. I have the handle to the mainframe window of newly launched application. I am able to get the menu pointer using CWnd::GetMenu() from the mainframe pointer. But this works only with the applications like Notepad and Adobe Reader where menu is the intigral part of the mainframe. Applications like MS Word and MS Excel have seperate docking windows for menu. At this time I am not able to get the menu from mainframe. For such application...

How to resize title of a chart in Excel?
Hi, Would you please tell me how to resize the title of a chart in Excel? Thanks, Roger Left-click on it then drag the handles to re-size. Gord Dibben Excel MVP On Sun, 31 Oct 2004 11:47:01 -0800, "Roger" <Roger@discussions.microsoft.com> wrote: >Hi, > >Would you please tell me how to resize the title of a chart in Excel? > >Thanks, > >Roger The Chart title will adjust automatically to the size of the text. If you want more control over the width or height, you can delete the title, and use a text box instead. To create a text box, select the ch...

Why won't the 'Job Title' field display in a contacts folder?
I want my contacts folder to display the field 'Job Title' that I have filled in for all my contacts, but all I get is a blank column. This also seems to apply to several other (but not all) fields in Contact Properties. ...

Excel Tool Bars and Menu Bar
Where are the settings stored for Excel's Tool Bars and Menu Bar if I make customized changes? Search for *.xlb files on your hard drive. The settings are stored there. AFAIK, you can't examine these files. HTH Paul ----------------------------------------------------------------------- >Where are the settings stored for Excel's Tool Bars and >Menu Bar if I make customized changes? ...

How do I create a shortcut on the Outlook Bar, that will open the News program?
How do I create a shortcut on the Outlook Bar, that will open the News program? In the same way as doing: View: Go To: News Thank You "Sam Kerracher" <kingpin128@lineone.net> wrote in message news:%23O4ukzQ4DHA.1804@TK2MSFTNGP12.phx.gbl... > How do I create a shortcut on the Outlook Bar, that will open the News > program? In the same way as doing: > View: > Go To: > News > > Thank You > > Copy the OE shortcut onto the bar. Then Right-click on it, select Properties, and on the Target line, add the switch /outnews leaving a space between the &quo...

Adding Trendline To Just Some of the Bars in Chart
Is it possible to add a trendline to just some of the bars in a chart? Suppose each bar represents a month, and you wanted to just show a trendline beginning with a month that wasn't the first month in the chart. Is this possible? Thanks, Carroll Rinehart Add the desired points as another data series and have XL calculate the trendline for this series. You can always format the series so that it appears invisible. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <1140795679.754703.3...

Move x axis to the top of a 3D horizontal bar chart
How do I change the position of the x axis to the top of a horizontal 3D bar chart, in 2003? I believe you should go to "format axis" on y-axis > scale tab > change "category (x) axis crosses at:" to desired value. hope this helps. you may have to adjust your bars or afterwards "Move x axis to top of horz. 3D Bar Chart" wrote: > How do I change the position of the x axis to the top of a horizontal 3D bar > chart, in 2003? ...

Color formatting pivot bar chart
I have a bar chart that shows the top 5 40 segments broken down by each teritory. It graphs good, but I need to color code the segments into their groups. So 1-5 may be one group, 6-13 will be another. When I color code all turn the same color. I would like to conditional format on the worksheet. Can that transfer to the chart? How do I manually make the segments change. Each territory will not have the same top 5 segments, thus using pivot to help with this task. The top 5 are from a generated report. I could bring all 40 but will still want to graph top 5. Thanks. Hi, It i...

how do i clear the recents documents dropdown bar in excel 2007
Click on Office Button>Excel Options>Advanced>Show this number of recent document: = 0 (below Display heading) Regards, Shailesh Shah http://in.geocities.com/shahshaileshs/ (Free addins Office Menu-2003 for Office-2007) If You Can't Excel with Talent, Triumph with Effort. "longblackcoat" <longblackcoat@discussions.microsoft.com> wrote in message news:DE7AEBFC-15BD-4548-9F57-838D9EA06237@microsoft.com... > ...

The vertical title on every chart I make is cut off.
I cannot read the end of my vertical title in excel. My computer is the only one I know of with this problem. "Fundamental Entropy" looks like "Fundamental Entr" with half of the "o" visible. If I place a character several spaces over, I can see the entire word. This occurs on the y-axis of every excel graph I open on my machine and I am sick of it. You could try the suggestion in the following MSKB article: The 'Y' axis label of your chart is truncated in Excel for Windows http://support.microsoft.com/default.aspx?scid=870698 nukervilletro...

y-axis titles get cut off #3
I tried them, and it seems that they were already unfrozen. Oh well thanks anyways. Any other ideas -- choola ----------------------------------------------------------------------- choolan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1623 View this thread: http://www.excelforum.com/showthread.php?threadid=27644 Try adding a couple of spaces, followed by a period, at the end of the title. You can format the period in white font colour, so it won't print. Jon Peltier has a couple of other suggestions in the following posting: http://groups.google.c...

simple chart change bar colour if A2 = ... etc
Making a very simple chart from the data in cells A1, A2 and A3. A1 contains the date. A2 contains either a 0 or a 1. A3 contains a dollar amount. Can I get Excel to change the bar colour based on the value in A2? If A2 = 0 bar colour = red if A2 = 1 bar colour = blue. Hi, The simplest way is to use 2 data series. One for the red and one for the blue data. A formula based on A2. Have a look at Jon's examples for conditional charts. http://peltiertech.com/Excel/Charts/ConditionalChart1.html Cheers Andy fitful_thought wrote: > Making a very simple chart from the data in cells A...

can not find New Contact Group option on tool bar?
Help! I can not find New Contact Group option on tool bar? Where is it and how do I get it to show up so I can create a contact group? Thanks in advance. Tools | Windows Contacts | New Contact Group. -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "Nanci" <grog4444@yahoo.com> wrote in message news:eI4gS80jKHA.2160@TK2MSFTNGP02.phx.gbl... > Help! I can not find New Contact Group option on tool bar? Where is it > and how do I get it to show up so I can create a contact group? > > Thanks in advance. "Nanc...

Floating Bar with Quartile Ranks
I'm looking to create a floating bar chart separated into four quartiles to plot some statistical data. For example, I'd be plotting the 5th percentile, 25th percentile, median, 75th percentile, and 95th percentile to separate the bar into 4 sections. I would then overlay another data point that fits into one of those sections. Any suggestions on how to do that? On Thu, 21 Aug 2008, in microsoft.public.excel.charting, GH <GH@discussions.microsoft.com> said: >I'm looking to create a floating bar chart separated into four quartiles to >plot some statistical data. ...

Changing the Width of Bars in a Horizontal bar Graph
Hi, I cannot seem to figure out who to change the width of each bar in a horizontal bar graph. Can someone please advise me as to how I could do this. Thanks in advance :) Double click the plotted series and in the resulting dialog box select the Options tab. In there adjust the 'Gap Width' value. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <E50AE3D4-394B-4561-8C72-023334E656AC@microsoft.com>, Ott1 @discussions.microsoft.com says... > Hi, I cannot seem to figure out w...

Bar Coding
We are thinking about implementing bar coding at our central warehouse and was wondering if anyone has anything pertinent to share. We just went on GP10 and have approximately 22,000 stock items but probably would not bar code everything. I would be curious to know if there are any operational issues with hardware and software before we take the dive. Thanks, craig We have about 17K distinct items and successfully utilize vSync's vShip and MaximumData's InTouch to implement barcoding quite successfully. We elected to use MC9090 scanners although MaxData defaults to another ...

Fix the bar graphs in Excel
How do you fix the bar graphs in Excel so that the bars are proportionately the correct size as the other bars in other graphs? You want them the proportional in height? Use the same axis scales. You want the same widths? Use the same numbers of categories and series in each chart. Otherwise you'll tweak yourself to death.... - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ yo wrote: > How do you fix the bar graphs in Excel so that the bars are proportionately > the correct size as the oth...

MS Word 2002
I have MS office 2002 programs on my laptop (Windows Vista) and for some reason, whenever I go to click something on the menu bar - for instance File, Edit, or View - the drop-down won't show up. All I get is a vague outline of the right-hand side of the drop down. Same with text color, font style, etc. I can still use it, sort of; if I know that the Save As option is n number of spaces down when I click File, I can use the down-arrow key to move that many spaces. The thing is, I don't have all that memorized, and I really want to fix this. It's on all the Windows p...

Colors for chart bars
Hi, in a document I want to add a bar chart. This document will is a paper and later converted to pdf. In the diagram I will have tree groups with 4 bars each. My question: which color would you take for the 4 adjacent bars? And what DPI? The diagram (figure in eps format) will be relatively small and I want that the reader can still distinguish among the bars when the paper is printed. Are there any preferred combinations of colors due to the "theory of colors"? Thank you. Chris If you're trying to get the most visually diverse colors, I would try to take colors from op...

Change Report Title before Emailing
On the cmdUpdate_Click button, the record is appended to the permanent file, a report is generated and emailed, and the form is cleared for the next record. I would like to append the date to the report title. The date currently prints as part of the subject line of the email, but I do not want the recipient to have to change/edit the document name. I posted on the Report page but have not received a reply. -- Teach me to fish! Thanks for the help. Pax, M =?Utf-8?B?bSBzdHJvdXA=?= <mstroup@discussions.microsoft.com> wrote in news:45811C3B-F028-4ACE-8419-8B077EC3E9F5@microso...