473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to get standard windows's title and menu 's height?

Hi:
i try to use GetWindowRect and GetClientRect API,but i think it wrong.
Following as:

GetWindowRect((int)hwnd,ref windowRect);
GetClientRect(hwnd,ref clientRect);
int winHeight = (windowRect.bottom - windowRect.top) -
(clientRect.bottom - clientRect.top);

Is winHeight title and menu's height?
there are have other methods?

THS
Ekey

Nov 16 '05 #1
2 7521
Hi Ekey,

How about:
SystemInformation.CaptionHeight (from MSDN "Use CaptionHeight to determine
the size of the standard window caption.")

and:
SystemInformation.MenuHeight

Both are in the System.Diagnostics namespace.

Cheers,
Allan.
"Ekey" <ch***********@newtouch.com.cn> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi:
i try to use GetWindowRect and GetClientRect API,but i think it wrong.
Following as:

GetWindowRect((int)hwnd,ref windowRect);
GetClientRect(hwnd,ref clientRect);
int winHeight = (windowRect.bottom - windowRect.top) -
(clientRect.bottom - clientRect.top);

Is winHeight title and menu's height?
there are have other methods?

THS
Ekey

Nov 16 '05 #2
Make that, the System.Windows.Forms namespace.

"Allan Taunt" <al*************@NO-hotmail-SPAM.com> wrote in message
news:uy**************@TK2MSFTNGP09.phx.gbl...
Hi Ekey,

How about:
SystemInformation.CaptionHeight (from MSDN "Use CaptionHeight to determine the size of the standard window caption.")

and:
SystemInformation.MenuHeight

Both are in the System.Diagnostics namespace.

Cheers,
Allan.
"Ekey" <ch***********@newtouch.com.cn> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi:
i try to use GetWindowRect and GetClientRect API,but i think it wrong. Following as:

GetWindowRect((int)hwnd,ref windowRect);
GetClientRect(hwnd,ref clientRect);
int winHeight = (windowRect.bottom - windowRect.top) -
(clientRect.bottom - clientRect.top);

Is winHeight title and menu's height?
there are have other methods?

THS
Ekey


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Robert Mark Bram | last post by:
Hi All! Is there a way to reference a window by name without doing something like this: open (, 'windowName'); The open method will open a blank window if there is no window with such a name....
1
by: Duane | last post by:
Hi ... here is my situation: I am building an application that is driven by a main menu. When the user chooses an option from the main menu that spawns a new window (or module). From that(or...
4
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
12
by: yoshimitsu | last post by:
Hi, I have decided to use a MainMenu in my main form. I have a menu item "Open Form". When this item is clicked I want the "newform.frm" to open just below the menu in the main form. How can this...
19
by: Lauren Quantrell | last post by:
In Windows XP display Properties/Appearance users can chose between: Windows XP Style or Windows Classic Style. Is there a way in VBA to determine the user's selection? The reason: Toolbars...
2
by: Ekey | last post by:
Hi: i try to use GetWindowRect and GetClientRect API,but i think it wrong. Following as: GetWindowRect((int)hwnd,ref windowRect); GetClientRect(hwnd,ref clientRect); int winHeight =...
2
by: Max | last post by:
Hello, Is there a way to determine the size (height) of a windows title bar? I am trying to position a window of an application so that the top edge of the window aligns with the top edge of...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
3
by: Jon Slaughter | last post by:
I'm tryign to display my own title bar. I've created a window without one but with a menu. The menu though is located in the upper left corner and I need to move it down. I need to set the client...
6
by: RickH | last post by:
Hello, I would like to create a user XSD data type that inherits from the w3 standard data type called ID to make sure a certain repeated element always contains distinct values. The problem is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.