?
Solved

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

Posted on 1998-02-24
2
Medium Priority
?
362 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 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

765 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