Archive

Posts Tagged ‘windows 3’

What Operating Systems does Delphi support?

December 15th, 1999 m3Rlin 1 comment

* Delphi 1 supports Windows 3.1x so programs compiled should run with no problems under operating systems that provide Windows 3.1 emulation, like OS/2 Warp, Windows 9x, NT, 2000, ME and XP and Linux with WinE.

* Delphi 2 and newer support Windows 95/98/NT/2000/ME/XP or Linux with WinE. Programs compiled with these compilers WILL NOT run under standard Windows 3.x or OS/2 Warp. Kylix is the Linux version of Delphi.

* Delphi up to version 3 has been reported to work with no problems with Linux using the WinE emulator. Programs compiled with Delphi 2+ may run under Windows 3.x with Win32s.

* Delphi 4 and newer support Windows 9x, NT, ME, 2000, XP and Vista. Minimum Operating System requirements generally depend on which components and libraries you are using in your applications.

* Kylix was the Linux version of Delphi that Borland created but no longer maintains or sells.

* Because there is no Delphi version for OS/2 you may want to try out SpeedSoft’s Sybil. It is almost 100% compatible with the first versions of Borland Delphi.

Why Don’t Applications Written in Delphi “Fly” to the Taskbar?

December 15th, 1999 m3Rlin No comments

Applications created in Delphi 1 to 4 (not 5 and up) don’t “fly” to the taskbar but hide like in Windows 3.1x. This is because Borland’s programmers turned this function off. Why?! Well, this is because the main window of the program is not the one we create in the IDE. The program’s main window is TApplication, so if the animation were turned on the application would “fly” but it would be kinda weird because it wouldn’t be our main window that would “fly”:) Well, there are a few ways to get over this:

1) You can turn on the window animation in the unit Form. Before doing this though you may want to back up this unit ;-)
Here’s the code:

  ...
  procedure ShowWinNoAnimate(Handle: HWnd; CmdShow: Integer);
  var
    Animation: Boolean;
  begin
    Animation := GetAnimation;
    if Animation then
      SetAnimation(False);
    ShowWindow(Handle, CmdShow);
    if Animation then
      SetAnimation(True);
  end;
  ...

Because this procedure is called from other functions it should be changed to:

  ...
  procedure ShowWinNoAnimate(Handle: HWnd; CmdShow: Integer);
  begin
    ShowWindow(Handle, CmdShow);
  end;
  ...

2) I would consider this is the best way. Add this code to your project’s source unit:

  ...
  uses
    Windows;
  ...
  var
    iExStyle: Integer;
  ...
    Application.Initialize;
    iExStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);

Add this code to your main window’s unit:

  ...
  public
    procedure CreateParams(var Params: TCreateParams); override;
    procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
  ...
  procedure TMainForm.CreateParams(var Params: TCreateParams);
  begin
    inherited CreateParams(Params);
    with Params do
      ExStyle := ExStyle or WS_EX_APPWINDOW;
  end;

  (* This will take care of the Minimize command so that the proper window
   * will "fly" to the taskbar.
   *)
  procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
  begin
   if Message.CmdType and $FFF0 = SC_MINIMIZE then
     WindowState := wsMinimized
   else
     inherited;
  end;

3) This is the worst you can do :-) Use a Delphi component to do the job.