Registriert seit: 18. Nov 2017
129 Beiträge
Delphi 12 Athens
|
AW: Application.MainFormOnTaskbar wird ignoriert (10.4)
9. Aug 2020, 18:23
Hallo,
vielleicht hilft folgendes:
Delphi-Quellcode:
program Project1;
uses
Vcl.Forms,
Unit1 in ' Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
//Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
und Unit:
Delphi-Quellcode:
unit Unit1;
interface
uses
Winapi.Windows,
System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm1 = class(TForm)
BtnBeenden: TButton;
procedure BtnBeendenClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
var
MyOwner: HWnd;
begin
MyOwner:=GetWindow( Handle,GW_OWNER);
ShowWindow(MyOwner,SW_HIDE);
end;
procedure TForm1.BtnBeendenClick(Sender: TObject);
begin
Close;
end;
end.
|
|
Zitat
|