Solved

Getting a pointer to CWnd for your system menu

Posted on 2004-04-04
7
237 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Title # Comments Views Activity
if loop in java 3 152
move a line in eclipse 3 107
has77  challenge 9 88
java ^ examples 8 69
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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

808 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