🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12797

Re: HowTo: Limiting window size

#12797
From: Martin Golm
Date: Tue, 18 Nov 2003 09:27
27 lines
2055 bytes
"Ed Mulroy [TeamB]" wrote:
> 
> Look at the help on the Windows message WM_GETMINMAXINFO  You can enforce a
> minimum size on the window by altering the data values in the structure
> whose address is passed with that message.
> 
> You can determine how much taller the window height is than the client
> height during the WM_CREATE message by calling the GetWindowRect and
> GetClientRect functions and subtracting and keeping the result around for
> later use.

Thanks Ed.
However, calculating during WM_CREATE didn't work because there's no
window handle I can use. (Or did I miss something?)
Instead I used AdjustWindowRect to calculate the minimum window height
(there's no menu assigned to the window, so multi-lined menus aren't an
issue) during WM_GETMINMAXINFO. If the window height from
WM_GETMINMAXINFO is smaller than my minimum window height, I set it
accordingly.

@Jonathan Arnold and Palle Meinert:
I am aware of the MinHeight property and the existance of third-party
components. But I create a WinAPI-only application, so VCL is no option.
Thanks anyway.


Martin
Technical Details
Message-ID: <3FB9E5FE.8824A78A@gmx.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3FB38C27.2C3183E5@gmx.de> <3fb395bf@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,498b056766cdd000
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-18 02:09:27 PST
Message-ID: <3FB9E5FE.8824A78A@gmx.de>
Date: Tue, 18 Nov 2003 10:27:26 +0100
From: Martin Golm <golm@gmx.de>
X-Mailer: Mozilla 4.72 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: HowTo: Limiting window size
References: <3FB38C27.2C3183E5@gmx.de> <3fb395bf@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.156.29.253
X-Trace: newsgroups.borland.com 1069148884 62.156.29.253 (18 Nov 2003 01:48:04 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail