473,408 Members | 1,749 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,408 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 7524
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.