BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi 5 - How do I find the height of a window header???

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Maria
Guest





PostPosted: Tue Apr 20, 2004 6:02 pm    Post subject: Delphi 5 - How do I find the height of a window header??? Reply with quote



Hello All,

Does anyone know how to get the height of a window's header. There is a big
difference between the height of an XP header and older versions.

Thanks for all your help

Maria


Back to top
Jon Lennart Aasenden
Guest





PostPosted: Tue Apr 20, 2004 10:54 pm    Post subject: Re: Delphi 5 - How do I find the height of a window header?? Reply with quote



not sure, but you can try:

FHeight:=(Height-ClientHeight);

Jon Lennart Aasenden,
Norway

"Maria" <maria (AT) softstuf (DOT) com> wrote

Quote:
Hello All,

Does anyone know how to get the height of a window's header. There is a
big
difference between the height of an XP header and older versions.

Thanks for all your help

Maria





Back to top
Peter Haas
Guest





PostPosted: Wed Apr 21, 2004 12:01 am    Post subject: Re: Delphi 5 - How do I find the height of a window header?? Reply with quote



Hi Maria, Jon,

Jon Lennart Aasenden wrote in <4085aa31$1 (AT) newsgroups (DOT) borland.com>:
Quote:
not sure, but you can try:

FHeight:=(Height-ClientHeight);

this is valid for a borderless and menuless window, but this don't have
a title bar.

To get the pure header for a window without menu in this manner, you can
use:

var
b, h: Integer;

b := Width - ClientWidth;
h := Height - ClientHeight - b;

If you want to get the header + border:

b := (Width - ClientWidth) div 2;
h := Height - ClientHeight - b;


The correct way is:

h := GetSystemMetrics(SM_CYCAPTION);

Maria, please don't multipost, read
http://info.borland.com/newsgroups/netiquette.html

Bye Peter.
--
JEDI+ API, the active JEDI Header Conversions Project:
http://jediplus.pjh2.de/api

Back to top
Dominique Louis
Guest





PostPosted: Fri Apr 23, 2004 5:53 pm    Post subject: Re: Delphi 5 - How do I find the height of a window header?? Reply with quote

Maria wrote:
Quote:
Hello All,

Does anyone know how to get the height of a window's header. There is a big
difference between the height of an XP header and older versions.

Thanks for all your help

You could try
GetSystemMetrics( SM_CYCAPTION );

Or alternatively here is a class I have found usefull...

TWinSystemMetrix = class
protected
function GetValue(index: Integer): Integer;
public
property Arrange: Integer index SM_ARRANGE read GetValue;
property CleanBoot: Integer index SM_CLEANBOOT read GetValue;
property MouseButtons: Integer index SM_CMOUSEBUTTONS read GetValue;
property BorderWidth: Integer index SM_CXBORDER read GetValue;
property BorderHeigth: Integer index SM_CYBORDER read GetValue;
property CursorWidth: Integer index SM_CXCURSOR read GetValue;
property CursorHeight: Integer index SM_CYCURSOR read GetValue;
property DlgFrameWidth: Integer index SM_CXDLGFRAME read GetValue;
property DlgFrameHeight: Integer index SM_CYDLGFRAME read GetValue;
property DoubleClickWidth: Integer index SM_CXDOUBLECLK read
GetValue;
property DoubleClickHeight: Integer index SM_CYDOUBLECLK read
GetValue;
property DragWidth: Integer index SM_CXDRAG read GetValue;
property DragHeight: Integer index SM_CYDRAG read GetValue;
property EdgeWidth: Integer index SM_CXEDGE read GetValue;
property EdgeHeight: Integer index SM_CYEDGE read GetValue;
property FixedFrameWidth: Integer index SM_CXFIXEDFRAME read
GetValue;
property FixedFrameHeight: Integer index SM_CYFIXEDFRAME read
GetValue;
property FrameWidth: Integer index SM_CXFRAME read GetValue;
property FrameHeight: Integer index SM_CYFRAME read GetValue;
property FullScreenWidth: Integer index SM_CXFULLSCREEN read
GetValue;
property FullScreenHeight: Integer index SM_CYFULLSCREEN read
GetValue;
property HScrollWidth: Integer index SM_CXHSCROLL read GetValue;
property HScrollHeight: Integer index SM_CYHSCROLL read GetValue;
property ThumbWidth: Integer index SM_CXHTHUMB read GetValue;
property IconWidth: Integer index SM_CXICON read GetValue;
property IconHeight: Integer index SM_CYICON read GetValue;
property IconSpacingWidth: Integer index SM_CXICONSPACING read
GetValue;
property IconSpacingHeight: Integer index SM_CYICONSPACING read
GetValue;
property MaximizedWidth: Integer index SM_CXMAXIMIZED read GetValue;
property MaximizedHeight: Integer index SM_CYMAXIMIZED read GetValue;
property MaxTrackWidth: Integer index SM_CXMAXTRACK read GetValue;
property MaxTrackHeight: Integer index SM_CYMAXTRACK read GetValue;
property MenuCheckWidth: Integer index SM_CXMENUCHECK read GetValue;
property MenuCheckHeight: Integer index SM_CYMENUCHECK read GetValue;
property MenuSizeWidth: Integer index SM_CXMENUSIZE read GetValue;
property MenuSizeHeight: Integer index SM_CYMENUSIZE read GetValue;
property MinWidth: Integer index SM_CXMIN read GetValue;
property MinHeight: Integer index SM_CYMIN read GetValue;
property MinimizedWidth: Integer index SM_CXMINIMIZED read GetValue;
property MinimizedHeight: Integer index SM_CYMINIMIZED read GetValue;
property MinSpacingWidth: Integer index SM_CXMINSPACING read
GetValue;
property MinSpacingHeight: Integer index SM_CYMINSPACING read
GetValue;
property MinTrackWidth: Integer index SM_CXMINTRACK read GetValue;
property MinTrackHeight: Integer index SM_CYMINTRACK read GetValue;
property ScreenWidth: Integer index SM_CXSCREEN read GetValue;
property ScreenHeight: Integer index SM_CYSCREEN read GetValue;
property SizeWidth: Integer index SM_CXSIZE read GetValue;
property SizeHeight: Integer index SM_CYSIZE read GetValue;
property SizeFrameWidth: Integer index SM_CXSIZEFRAME read GetValue;
property SizeFrameHeight: Integer index SM_CYSIZEFRAME read GetValue;
property SmallIconWidth: Integer index SM_CXSMICON read GetValue;
property SmallIconHeight: Integer index SM_CYSMICON read GetValue;
property SmallSizeWidth: Integer index SM_CXSMSIZE read GetValue;
property SmallSizeHeight: Integer index SM_CYSMSIZE read GetValue;
property ScrollWidth: Integer index SM_CXVSCROLL read GetValue;
property ScrollHeight: Integer index SM_CYVSCROLL read GetValue;
property CaptionHeight: Integer index SM_CYCAPTION read GetValue;
property KanjiWindowHeight: Integer index SM_CYKANJIWINDOW read
GetValue;
property MenuY: Integer index SM_CYMENU read GetValue;
property SmallCaptionHeight: Integer index SM_CYSMCAPTION read
GetValue;
property VThumbHeight: Integer index SM_CYVTHUMB read GetValue;
property DBCS_Enabled: Integer index SM_DBCSENABLED read GetValue;
property Debug: Integer index SM_DEBUG read GetValue;
property MenuDropAlignment: Integer index SM_MENUDROPALIGNMENT
read GetValue;
property MideastEnabled: Integer index SM_MIDEASTENABLED read
GetValue;
property MousePresent: Integer index SM_MOUSEPRESENT read GetValue;
property MouseWheelPresent: Integer index SM_MOUSEWHEELPRESENT
read GetValue;
property Network: Integer index SM_NETWORK read GetValue;
property PenWindows: Integer index SM_PENWINDOWS read GetValue;
property Secure: Integer index SM_SECURE read GetValue;
property ShowSounds: Integer index SM_SHOWSOUNDS read GetValue;
property SlowMachine: Integer index SM_SLOWMACHINE read GetValue;
property SwapButton: Integer index SM_SWAPBUTTON read GetValue;
{$IFDEF NoWin98}
property Monitors: Integer index SM_CMONITORS read GetValue;
property IMM_Enabled: Integer index SM_IMMENABLED read GetValue;
property RemoteSession: Integer index SM_REMOTESESSION read GetValue;
property SameDisplayFormat: Integer index SM_SAMEDISPLAYFORMAT
read GetValue;
property VirtualScreenWidth: Integer index SM_CXVIRTUALSCREEN
read GetValue;
property VirtualScreenHeight: Integer index SM_CYVIRTUALSCREEN
read GetValue;
property VirtualScreenX: Integer index SM_XVIRTUALSCREEN read
GetValue;
property VirtualScreenY: Integer index SM_YVIRTUALSCREEN read
GetValue;
{$ENDIF}
end;

implementation

function TWinSystemMetrix.GetValue(index: Integer): Integer;
begin
Result := GetSystemMetrics(index);
end;

Dominique Louis
http://www.DelphiGamer.com := go on, write a game instead;

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.