🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Button

#16826
From: Ed Mulroy [TeamB]
Date: Fri, 25 Apr 2003 12:46
33 lines
2582 bytes
That is a quite different problem than what I understood you to want from
your first message.

The title bar cannot have a window and a button is a window.  It is part of
the "non-client" area of the window, the area that is managed by Windows
itself.

There is a set of messages that Windows sends to the window procedure which
relate to the title bar and other non-client areas.  Most of them begin with
WM_NC (think of the NC as Non-Client), such as WM_NCPAINT and WM_NCHITTEST.

You can elect to handle those things and paint the title bar, frame, etc
yourself.
As an alternative you could create the window to not have a title bar.
Windows will handle the drawing of the borders.  Paint a title bar yourself
in response to a WM_NCPAINT message.  Put a button in there.  When someone
clicks in the non-button area of where your version of the title bar is
painted, respond to the WM_NCHITTEST message by returning HTCAPTION so that
Windows acts in the normal click-on-title-bar fashion.  You can get the
dimensions for the title bar from a call to GetSystemMetrics.

Note that this scheme means that for any of these which you want you will
have to implement the maximize, minimize or close boxes and system menu
yourself.

.  Ed

> CapStick wrote in message
> news:3ea89466@newsgroups.borland.com...
>
> I should have stated that
> i wished to place this button on the Title Bar
> i have managed thus far to place a rectangle on the bar
Technical Details
Message-ID: <3ea93061@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ea884eb$1@newsgroups.borland.com> <3ea89148@newsgroups.borland.com> <3ea89466@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,b6000c487f45b47e
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-25 06:02:58 PST
From: "Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ea884eb$1@newsgroups.borland.com> <3ea89148@newsgroups.borland.com> <3ea89466@newsgroups.borland.com>
Subject: Re: Button
Date: Fri, 25 Apr 2003 08:46:32 -0400
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 206.228.162.65
Message-ID: <3ea93061@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1051275361 206.228.162.65 (25 Apr 2003 05:56:01 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail