Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

598 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