Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1034553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:24:37+00:00 2026-05-16T14:24:37+00:00

Using Delphi I would like to add another button to the border icon buttons;

  • 0

Using Delphi I would like to add another button to the border icon buttons; close, maximize, minimize. Any ideas on how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:24:37+00:00Added an answer on May 16, 2026 at 2:24 pm

    This was easy to do prior to Windows Aero. You simply had to listen to the WM_NCPAINT and WM_NCACTIVATE messages to draw on top of the caption bar, and similarly you could use the other WM_NC* messages to respond to mouse clicks etc, in particular WM_NCHITTEST, WM_NCLBUTTONDOWN, and WM_NCLBUTTONUP.

    For instance, to draw a string on the title bar, you only had to do

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;
    
    type
      TForm1 = class(TForm)
      protected
        procedure WMNCPaint(var Msg: TWMNCPaint); message WM_NCPAINT;
        procedure WMNCActivate(var Msg: TWMNCActivate); message WM_NCACTIVATE;
      private
        procedure DrawOnCaption;
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    { TForm1 }
    
    procedure TForm1.WMNCActivate(var Msg: TWMNCActivate);
    begin
      inherited;
      DrawOnCaption;
    end;
    
    procedure TForm1.WMNCPaint(var Msg: TWMNCPaint);
    begin
      inherited;
      DrawOnCaption;
    end;
    
    procedure TForm1.DrawOnCaption;
    var
      dc: HDC;
    begin
      dc := GetWindowDC(Handle);
      try
        TextOut(dc, 20, 2, 'test', 4);
      finally
        ReleaseDC(Handle, dc);
      end;
    end;
    
    end.
    

    Now, this doesn’t work with Aero enabled. Still, there is a way to draw on the caption bar; I have done that, but it is far more complicated. See this article for a working example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using OmniXML and Delphi, I would like to locate an element and change another
I'm using Delphi XE and would like to add recent items in the Windows
I'm using Delphi XE and I would like to make a button which shows
I would like to be able to dictate into my Delphi application using Microsoft
In my Delphi application, I would like to add command line parameters to automatically
I have a query in Delphi using DBExpress TSQLQuery that looks like so ActiveSQL.sql.add('SELECT
Using Delphi 2010 I would like to copy a PNG image to the clipboard
I'm using Delphi 7. I would like to count the number of repetitions of
Hello I would like to develop using delphi 7 programming language but I have
I would like to draw an icon/bmp into a subitem of a TListView using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.