Solved

Getting a pointer to CWnd for your system menu

Posted on 2004-04-04
7
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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