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
1130 Views

Similar Articles

[PageSpeed] 32

>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:

Chart Title
HI All, Is there a way to link a chart title to a cell value? Thanks for your help. Regards Romiz Hi Romiz, Select the title box and then in the formula bar type '=' (without quotes). Now click the cell you want to link too. Cheers Andy Romiz wrote: > HI All, > > Is there a way to link a chart title to a cell value? > Thanks for your help. > > Regards > > Romiz -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info Hi Andy, Thanks so much. This is great (when you know). Thanks Regards Romiz >-----Original Message----- >Hi Romiz, &...

How to make visible the title of the table?
Is it possible to make the title of the table always to be visibl when I scroll down the table One way: Assuming headers are in row1, Select A2. Click Window > Freeze pane This freezes the 1st row, so it always remains in view when you scroll down And if you want to keep the 1st col, e.g.: col A in view as well as you scroll right (assuming col A contains the row headers), try selecting say, B2 instead of A2, then click Window > Freeze pane -- Rgds Max xl 97 --- GMT+8, 1� 22' N 103� 45' E xdemechanik <at>yahoo<dot>com ---- "mari - ExcelForums.com" &l...

Error bar
Do anyone know how to edit the width of error bar freely out of the three options available ? Dennis - If you mean the distance from the point to the end of the error bar, you can assign values from the worksheet, using the Custom (plus) and Custom (minus) entry boxes. If you mean the size of the dash at the end of the error bar, Excel picks it, and all you can do is show it or hide it (Format - Patterns). - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ dennis wrote: > Do anyone know how to edi...

Show growth in the bar chart
Hi, I would like to create a bar chart from the following data: First period: 71 Second period: 110 Growth from first period to second period: 110-71 = 39 - Assume that the growth of 39 is attributed to the two drivers. - The first driver contributes 20 and the second contributes 19. The chart would look like: 71 110 39 20 19 +----+ +----+ +-----+ | | | | | | | | | | +------+ +-----+ | | | | ...

show icon for desktop on the task bar
i have windows 7 vista could you tell me how to do what is given in the subject above? Is office the right forum for such a question if not which is? thank you "Aamir" <Aamir@discussions.microsoft.com> wrote in message news:D50E493E-A484-4139-B16A-789613DEBCCF@microsoft.com... > i have windows 7 vista could you tell me how to do what is given in the > subject above? > > Is office the right forum for such a question if not which is? > > thank you Vista General is the proper place to post this. On your taskbar to the right of the clock ...

How to make Three Bars and one line with a second axis in EXCEL
I want to make a Chart in EXCEL such that I canhave three or more BARS and one Line..The line I want in a second axis. Let's say you have three series that you want for bars and one that you want plotted as a line. Create a bar chart using all 4 series. Select the series that you want to change to a line and right click on the series. You can change the chart type for the series at this point. I believe it will put it on a secondary axis automatically. "JAS123" wrote: > I want to make a Chart in EXCEL such that I canhave three or more BARS and > one Line..T...

Scroll Bars in Excel 2008
I am having a problem with Excel in Office 2008. All of a sudden I noticed that the scroll bars are no longer visible. I have have checked what I think are the appropriate boxes in "Excel Option Display" but the scroll bars still do not appear. What am I doing wrong? Thank you Gene L. Sorry, I meant Excel in Office 2007 not 08 Sorry about that! Gene L. "Gene L." <camelotscc@tampabay.rr.com> wrote in message news:580FE013-FDE1-41C9-9DDE-23BFF2971259@microsoft.com... >I am having a problem with Excel in Office 2008. All of a sudden I noticed >that the scro...

side-by-side relative frequency bar graph
very basic statistics student. using excel how does one how to make a side-by-side relative frequency bar graph? I know how to make a relative frequency distribution bar graph but do not how to combine two of these into one graph (side by side). Thanks Are you looking for a tornado chart? http://peltiertech.com/Excel/Charts/tornadochart.html Even better would be a dot plot with two sets of markers: http://peltiertech.com/Excel/Charts/DotPlot.html The dot plot makes it easier to compare the values directly. A tornado moves the values away from each other, and it's harde...

My Shortcuts to stay open on the Outlook Shortcut Bar
I have a user who would like `My Shortcuts' to remain the open default on the Outlook Shortcut Bar. Currently when she closes & re-opens the application `My Shortcuts' minimizes & `Outlook Shortcuts' expands. Is there a way to force `My Shortcuts' to be the open default, or is there a way to change the shortcut file order? I have tried re-creating her profile & that did not help. This was to hopefully fix another issue as well; the `Public Folders' file is showing as the first item in her Folder List rather than the Outlook Today folder or a delegate fo...

creating bar graph
Hello, I would like to create a bar-graph using the below data's. --------------------------------------------- Avg. Temp Low Normal High | --------------------------------------------- Jan 45.5 25 35 45 | Feb 28.6 18 25 35 | Mar 47.3 27 36 48 | April 51.4 31 39 51 | --------------------------------------------- Conditions: 1) If the Avg. Temp is below the "Low" value , bar colour should indicate in Yellow. 2) If the Avg. Temp is Below the "Normal"...

CListCtrl titles
Hello, I am working with a CListCtrl control in my VC++ app. I defined some columns o be displayed in the control. But I have been looking at the MSDN and did not find a way to set a title to every displayed colum in the CListCtrl. How can I do that ? Is there a way also to change the color of this title, as the backcolor of my list is black and I would like to display the titles in white ? Thank you for any help. -- Ceci est une signature automatique de MesNews. Site : http://www.mesnews.net ByB wrote: > Hello, > > I am working with a CListCtrl control in my VC++ app. I d...

SETTING AXIS TITLE
All, we have a chart that we want to change the Category Axis Title (the title that exists below the X axis). we have looked at all the properties around activechart with little sucess. grateful for any assistance here. matt A "matt a" <matta@discussions.microsoft.com> wrote in message news:2E400B58-D209-4D0B-A49D-DB496D7124A2@microsoft.com... > All, > > we have a chart that we want to change the Category Axis Title (the title > that exists below the X axis). > > we have looked at all the properties around activechart with little sucess. > > gratef...

create range bar graph
I need to create a range bar graph in excel. Basically given an end point for each corresponding value on the y-axis it'll plot a horizontal bar up to that endpoint. The next horizontal bar will continue for where the prev. ended. Similar to this: http://www.ncsu.edu/labwrite/res/gh/gh-bargraph.html#rangebar How would I do it? ;) Many Thanks! Example Data: Task1 --> Range 0-30 Task2 --> Range 31-46 Task3 --> Range 46-48 Task4 --> Range 48-60 Task5 --> Range 61-70 ... -- Aussie1497 ------------------------------------------------------------------------ Aussie1497...

Scroll Bar from horizontal to vertical orientation
I have a horizontal scroll bar in the lower left corner of a chart... not linked to a macro, but to a cell value for its control. I would simply like to convert it from its horizontal posture to a vertical placement so that I can move it into another area on the chart's y-axis border, one not blocking the x-axis dates. I keep thinking the solution would be found in "Properties," but I don't see a solution there. My thanks in advance for a clue or a solution! Cheers! Brad Hi, The orientation of the control is dictated by the ratio of width to height. Just grab a...

Creating a Simple Bar Chart
I've got 2 columns of numbers - column A is a continuous set of integers going from about 40 to 210; column B is a frequency count going from blank up to 10. A sample is shown below. PROBLEM 1 Using XL2007 I can't even seem to get a simple bar chart showing frequency count (y axis) against number (x axis). I just get either a total as a single bar or a cumulative count. PROBLEM 2 Once I've got this working I'd like to be able to group those numbers (eg into 5's or 10's) so as to reduce the length of the x-axis Can SKS help out please. Tx 44 2 ...

msgbox title issue
hi, as per documentation msgbox will display "vbscript:" followed by user given title text. i want to get rid of it. it doesn't happen in my local browser (IE 7). but happens in another machine. can tht be handled in script. any advice is appreciated "Sathya" <user@msgroups.net/> wrote in message news:u4FoI9nyKHA.4752@TK2MSFTNGP04.phx.gbl... > hi, > as per documentation msgbox will display "vbscript:" followed by user > given title text. i want to get rid of it. it doesn't happen in my local > browser (IE 7). but happens in anot...

standard menu bar
can anyone assist me to reset standad menu bar. I'm afraid I run a db exemple that make disappear the menu thanks On Thu, 28 Jun 2007 02:25:08 -0700, misentima@hotmail.com wrote: >can anyone assist me to reset standad menu bar. >I'm afraid I run a db exemple that make disappear the menu You probably set some startup options that made the menubar disappear. Try holding down the Shift key while opening the database; this should get the menubar back (assuming you haven't also disabled the Shift Key Bypass, that is). If this works, then click Tools - Startup and recheck the ...

error bars #3
i'm trying to create error bars but i don't seem to have "selected data series" in my format menu. can anyone help? That will appear after you have selected a series in the chart. To select a series, click on a line, or column Or, select the chart, and select a series from the Chart Objects dropdown list in the Chart toolbar abc wrote: > i'm trying to create error bars but i don't seem to have "selected data series" in my format menu. can anyone help? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

Excel 2003 status bar autocalculate resize the width
On the status bar there is a cell with autocalculate functions. I would like to make it longer in order to see more data. Is it possible or the width is fixed? This is fixed width. Well, there have been lots of posts that use API calls that do things that I would have thought are impossible, but for most of us users, this is fixed width. Vasilis Glykos wrote: > > On the status bar there is a cell with autocalculate functions. I would like > to make it longer in order to see more data. Is it possible or the width is > fixed? -- Dave Peterson ...

Add only SOME Fill effects to multiple bars
Hoping someone can help (Excel 2003) I have a column chart with one series displayed. I've gone into the Format Data Series option and 'varied the points by color' so each column is a different color. Easy enough. But now, I want to be able to add a specific pattern (Go into Fill Effects / Patterns tab) to each of these bars while maintaining their current color. The problem is as soon as I choose a pattern, it also applies the colors that were chosen as part of the current pattern Fill Effects. So I have to double-click each column manually to add the same pattern if ...

Tool Bar Won't Go Away
The "Microsoft Office Live Add-In" tool bar will not go away. I uncheck the box and that seems to work, however, when I close Excel and open it again, the Tool Bar is displayed again. This happens on all Office products, not just Excel. There must be a Registry Hack to avoid this. Thanks I resolved this when I went to Office 2007. "JCO" <someone@somewhere.com> wrote in message news:e9HGre5wJHA.1504@TK2MSFTNGP03.phx.gbl... > The "Microsoft Office Live Add-In" tool bar will not go away. I uncheck > the box and that seems to work, however, wh...

why does Equal sign not appear on the formula bar #2
next to the function button as it did in Excel 2000?? Why did they create this function wizard and make things more cumbersome?? Only the developers know why they did away with this in Excel 2002 and 2003. The return of this feature is on the wishlist for the next version. Adoption and Implementation of features on the wishlist is a whole 'nother matter. Gord Dibben Excel MVP On Mon, 24 Jan 2005 15:17:06 -0800, pvmonsour <pvmonsour@discussions.microsoft.com> wrote: >next to the function button as it did in Excel 2000?? Why did they create >this function wizard and ma...

Navigation Bar #2
I have a web page www.thespiceoflifecafe.com, and I have been updating for months now, Monday I updated with 2 new pages, and now none of the Nav Links work. I deleted the Nav bar and put a new one in, still no luck. When I Web Page Preview It works but when I upload none of the links work. I am uploading everything each time, so I know it is all there. am using Publisher 2007, HELP!! If you mouseover the links on your navbar and look at the status bar at the bottom of your browser page, you will see that the links are pointing to your local hard drive. This sometimes happens when yo...

Excel
I'd like to be able to represent a limit level across a series of results either using one gridine or any other suggestions. The way I am doing it at the moment means that the limit columns are blocking the view of lower levels of data, values higher than the limit are obvious but ones lesser than are restricted from view. Any help please. http://peltiertech.com/Excel/Charts/AddLine.html - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "ju1eshart" <ju1eshart@discussions.microsoft.com> wrote in message news...

How do I show break in bar graph to show large and small numbers
...