Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Minimize button does not minimize a form

Posted on 2003-11-06
6
Medium Priority
?
418 Views
Last Modified: 2010-04-05
Even with a simple application (sample), the minimize button of the form, when you run it, does not minimize it !
I verified, that the biMinimize of BorderIcons is True.
What else has to be setup for this to work ?
0
Comment
Question by:LeTay
[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
6 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9693468
>What else has to be setup for this to work ?
Usually it works by default.
What operations have preceded to occurrence of the problem?
Do you use any "magic" components?
0
 

Author Comment

by:LeTay
ID: 9693875
Nothing special.
No magic components.
I need to find out of course what is different in that form.
Any idea of 'where' to search ?
0
 
LVL 2

Expert Comment

by:Ray_Adams
ID: 9696428
OnMinimize in form or applcation.
I don't know where to search, because i see no code.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 34

Expert Comment

by:Slick812
ID: 9696434
go through your form's  OnCreate  event and comment out one line at a time, and see if when you remove that line, the form will minimize,  also, do you get the  WM_SYSCOMMAND  message, that can change the minimize
0
 

Author Comment

by:LeTay
ID: 9699825
Slick812,
Will try that and keep you informed
0
 
LVL 3

Accepted Solution

by:
fibdev earned 300 total points
ID: 9709069
Sometimes you can trap yourself.  For example...

If you load the size and windowstate from the registry or an ini file in the wrong order you get a form that "appears" not to restore because the size is set after the form is maximized (did that make sence?)  look at this code snip:

This works...
========================================
procedure TSDIAppForm.FormCreate(Sender: TObject);
var i, w : integer;
begin
    FIniFileName := LowerCase(ExtractFileName(Application.ExeName));
    FIniFileName := '.\' + Copy(FIniFileName, 1, Length(FIniFileName) - 3) + 'ini';
    Ini := TInifile.Create(FIniFileName);
    // Window Dimentions
    with sdiappform do begin
      Left := ini.ReadInteger('window', 'left', 50);
      Top  := ini.ReadInteger('window', 'top', 50);
      Width := ini.ReadInteger('window', 'width', 450);
      Height := ini.ReadInteger('window', 'height', 400);
    end;
    // Windowstate
    w := ini.readinteger('Window', 'WindowState', 0);
      case w of
        0 : sdiappform.WindowState := wsNormal;
        1 : sdiappform.WindowState := wsMinimized;
        2 : sdiappform.WindowState := wsMaximized;
      end;
   // resize statusbar panels
    i := sdiappform.Width div 3;
    statusbar.Panels[0].Width := i;
    Repaint;
    Application.OnHint := DisplayHint;
    Ini.Free;
end;
=========================================

If this is recorded in the reverse order...

  If sdiappform.WindowState = wsNormal then w := 0;
  if sdiappform.WindowState = wsMinimized then w := 1;
  if sdiappform.WindowState = wsMaximized then w := 2;
  ini.WriteInteger('Window', 'WindowState', w);
  // if windowstate is not max then save current

  // dimentions...
  With sdiappform do
  begin
      // window dimentions
    Ini.WriteInteger('Window', 'Top', Top);
    Ini.WriteInteger('Window', 'Left', Left);
    Ini.WriteInteger('Window', 'Width', Width);
    Ini.WriteInteger('Window', 'Height', Height);
  end;  // Uh-Oh, your window dimentions are that of a maximized screen  :(

  // Workaround
  If windowstate <> wsMaximized then with sdiappform do
  begin
      // window dimentions
    Ini.WriteInteger('Window', 'Top', Top);
    Ini.WriteInteger('Window', 'Left', Left);
    Ini.WriteInteger('Window', 'Width', Width);
    Ini.WriteInteger('Window', 'Height', Height);
  end;  // If maximized, the last recorded wsNormal values will be saved.

It's late for me, so If I'm totally off the subject then excuse me :)  but, it may give you something to think about anyway.

fibdev
"A good manager leads by example... When that fails, brute intimidation works pretty well too."


 
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 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