Solved

Getting a pointer to CWnd for your system menu

Posted on 2004-04-04
7
228 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
Comment Utility
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
Comment Utility
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
Comment Utility
Attn moderators: I would suggest this question to be deleted...
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 21

Author Comment

by:Yurich
Comment Utility
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
Comment Utility
PAQ/Refund
0
 

Accepted Solution

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now