Solved

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

Posted on 1998-02-24
2
352 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now