Solved

Smoothly Minimize

Posted on 1998-06-18
8
331 Views
Last Modified: 2010-04-03
Does anyone know, why (correct me if i'm wrong) Delphi Apps do not minimize smoothly, like other windows application?
Does it have to do with the use of either VBL or MFC?
Is there anything I can do?
0
Comment
Question by:kyr
8 Comments
 
LVL 3

Expert Comment

by:altena
ID: 1353677
The (real) main window is hidden in a delphi application. That explains what you are seeing.

If this is a real big problem: Buy a copy of Petzold's book
and start at winmain(). Then you have full control.
0
 
LVL 3

Expert Comment

by:vladika
ID: 1353678
See
procedure TApplication.Minimize;
begin
  if not IsIconic(FHandle) then
  begin
    NormalizeTopMosts;
    SetActiveWindow(FHandle);
    ShowWinNoAnimate(FHandle, SW_MINIMIZE);  !!!!!!!!!!!!  <- THIS IS CAUSE OF TROUBLE
    if Assigned(FOnMinimize) then FOnMinimize(Self);
  end;
end;


0
 

Author Comment

by:kyr
ID: 1353679
Bying a book to get a single tip makes experts-exchange useless.
A am not interested in learning all the low level work needed to create a form.

I am just asking for some lines of code that will do this for me.
0
 

Author Comment

by:kyr
ID: 1353680
Thanks very much for your efford anyway.
I will have in mind the book for the future.

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:kyr
ID: 1353681
vladika,
Do you mean that all we have to do is to replace the default minimize routine with a custom one?
If you know details I would appreciate an answer.

kyriacos
0
 
LVL 2

Expert Comment

by:kjteng
ID: 1353682
hi
0
 
LVL 3

Accepted Solution

by:
vladika earned 120 total points
ID: 1353683
I think Altena is right.
The problem is The main window is hidden.

Maybe It's not good solution, but ...

Copy forms.pas into your project directory and
modify TApplication.Minimize;

procedure TApplication.Minimize;
var SaveRect, MainRect: TRect;
begin
  if not IsIconic(FHandle) then
  begin
    NormalizeTopMosts;
    SetActiveWindow(FHandle);
    if MainForm <> nil then
    begin
      GetWindowRect(FHandle, SaveRect);
      GetWindowRect(MainForm.Handle, MainRect);
      SetWindowPos(FHandle, 0, MainRect.Left, MainRect.Top, MainRect.Right-MainRect.Left, MainRect.Bottom-MainRect.Top, 0);
      ShowWindow(FHandle, SW_MINIMIZE);
      SetWindowPos(FHandle, 0, SaveRect.Left, SaveRect.Top, SaveRect.Right-SaveRect.Left, SaveRect.Bottom-SaveRect.Top, 0);
    end else
      ShowWinNoAnimate(FHandle, SW_MINIMIZE);
    if Assigned(FOnMinimize) then FOnMinimize(Self);
  end;
end;


0
 

Author Comment

by:kyr
ID: 1353684
thanx
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

21 Experts available now in Live!

Get 1:1 Help Now