Solved

How to determine StatusBar height?

Posted on 2002-03-28
12
706 Views
Last Modified: 2013-11-20
I created standard single socument MFC application by MFC Wizard. Window has StatusBar below. StatusBar uses window client area to paint itself into . How can I determine StatusBar height? Is there any method in CStatusBar class?
As I tested CStatusBar::GetWindowRect(&WinRec) doesn not work. :(  Thank you.
0
Comment
Question by:VadimY
12 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 6904570
I think CStatusBar::GetItemRect(int nIndex, LPRECT lpRect)
is what you're looking for.

zzynx.
0
 
LVL 4

Expert Comment

by:mblat
ID: 6907807
I don't now - I just went and created fresh SDI app. using VC++ on Win2000 machine.

Added menu item.  In that item handler after calling

CRect rc;
m_wndStatusBar.GetWindowRect(&rc);

result appear to be correct....

m_wndStatusBar is status bar created by wizard....

So I probably don't understand your question fully...
0
 
LVL 37

Accepted Solution

by:
zzynx earned 40 total points
ID: 6912186
As I said before:
I think CStatusBar::GetItemRect(int nIndex, LPRECT lpRect)
is what you're looking for.

zzynx.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 37

Expert Comment

by:zzynx
ID: 7055540
Hey VadimY,

why aren't you giving points? We're waiting!

I see this is your first (and only) question.
I hope you are not exploiting this site to easily get an answer on your question without following the rules.

There are masses of other sites you can use for that.

zzynx.
*irritated*
0
 
LVL 7

Expert Comment

by:peterchen092700
ID: 7100128
Vadim: please provide the following information:

1) do you need the height of the entire status bar, including it's "border", or do you need the size of the area where you can paint in?

For the first use GetWindowRect, for the second, GetItemRect.

Where and how do you use GetWindowRect, and what does "does not work" mean specifically? Do you get error messages when compiling, wrong results?

0
 
LVL 7

Expert Comment

by:peterchen092700
ID: 7100140
Vadim: Until the problem is solved, I would recommend you reject zzynx' answer. There is no drawback involved, you can later award the points to any expert you like.

zzynx: welcome to experts-exchange.
First, VadimY isn't oblieged to provide points until he is satisfied with the solution, or there is no more input to expect.
Second, please provide an "Answer" (instead of a Comment) only if you're 100% sure your reply is exactly what the asker needs, there are no open issues, and there is no other comment already which might also help answering the question.

Many long-time experts prefer to post only comments, as experience has shown EE works smoother this way.

Please read about Comments and Answers about
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#5
0
 
LVL 37

Expert Comment

by:zzynx
ID: 7102873
Hi peterchen,

I know 'VadimY isn't oblieged to provide points until he is satisfied with the solution'. And I know that it's common use on EE not to provide answers but comments.

But since I saw VadimY isn't quite 'active' anymore on this subject (and VadimY is member since 28 march and his only question is dated 28 march)
I thought proposing my comment as an answer could trigger him to some action.
0
 
LVL 11

Expert Comment

by:griessh
ID: 7203953
Dear VadimY

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "zzynx"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 37

Expert Comment

by:zzynx
ID: 7224540
Hi griessh,

Looks like we shouldn't expect any futher activity from VadimY.

Any idea what happens with the points in case Support closes it?

zzynx.
0
 
LVL 7

Expert Comment

by:peterchen092700
ID: 7224615
you get them, zzynx. Unless you object, of course ;)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 7224645
Not really, not really. ;o)
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7234003
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question