Solved

Getting a pointer to CWnd for your system menu

Posted on 2004-04-04
7
238 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
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!

 
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

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

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 112
Process filename extension 3 208
Path of Workbook 3 86
JQuery serialize and unserialize 8 185
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

740 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