473,324 Members | 2,254 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,324 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 7516
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.