Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting a pointer to CWnd for your system menu

Posted on 2004-04-04
7
Medium Priority
?
259 Views
Last Modified: 2013-11-20
hello everybody,
i would appreciate some help on the following:

i need to get the size of my system menu (file, edit, and etc.). if i need to get a size of a control, i'd use:

CRect rect;
CWnd* pControl = GetDlgItem( ID_CONTROL );
pControl->GetWindowRect( &rect );

A system menu is not apparently a dialog item, but it's still a window, so you can get a pointer to it. There is a function GetWindow( nCmd ), and I presume that nCmd in the case of my menu should be GW_CHILD, but when i do the following:

CRect rect;
CWnd* pMenu = GetWindow( GW_CHILD );
pMenu->GetWindowRect( rect );

I'm not even sure rect of what it returns :(...

I'm pretty much sure it's not difficult and probably I'll get it myself by the time I get the answer in here, but if someone gives a hint, it may greatly simplify the issue.thanks
0
Comment
Question by:Yurich
  • 3
  • 2
7 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10751649
Are you looking for the size of the menu bar (File, Edit, ...), or a menu?

Please provide some information about what you want to accomplish. There may be other ways to accomplish the same with a different approach.
0
 
LVL 21

Author Comment

by:Yurich
ID: 10751992
sorry for obscurity...
it's the size of the menu bar.
what do you mean under "a menu"?? i didn't specify because i though of a menu as of a menu bar...
thanks
0
 
LVL 21

Author Comment

by:Yurich
ID: 10858339
Attn moderators: I would suggest this question to be deleted...
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 21

Author Comment

by:Yurich
ID: 10866505
actually, if someone is still interested, i've found a very simple solution for this:

int nMenuHeight = ::GetSystemMetrics( SM_CYMENU );

...that's all i needed.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10867410
PAQ/Refund
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10902532
Closed, 35 points refunded.
modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

886 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