Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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