Solved

Minimized icon's caption <> Form's caption = Why?

Posted on 1998-02-24
2
361 Views
Last Modified: 2010-04-06
Delphi 1 question...

In a new project go to "Options | Project | Application" and enter "Testing
123" in the application's "Title" field.  Then when the project is run,
change the main form's caption to read "Form1.Caption := 'My form';   Then
minimize the application from Windows 95.  Look at the Task Bar and you
will NOT see "My form" as the minimized icon's caption, but rather you will
see the Application's Title!

Most applications (non Delphi) that I have seen display the form's caption
as the icon's caption when the form is iconized/minimized.  How does one
accomplish the same behavior with Delphi 1?
0
Comment
Question by:Kapusta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
inter earned 50 total points
ID: 1359764
The following does what you want:(for more help look TApplication.OnMinimize and Onrestore events)

unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    SaveTitle : string;
    procedure Minimizing(Sender: TObject);
    procedure Restoring(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation
{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnMinimize := Minimizing;
  Application.OnRestore  := Restoring;
end;

procedure TForm1.Minimizing(Sender: TObject);
begin
  SaveTitle := Application.Title;
  Application.Title := Form1.Caption;
end;

procedure TForm1.Restoring(Sender: TObject);
begin
  Application.Title := SaveTitle;
end;

end.

Sincerely,
Igor
0
 

Author Comment

by:Kapusta
ID: 1359765
Great example, and it works perfectly.  Thanks!  :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question