dllaboutform.pas

来自「Delphi Win32核心API参考光盘源码 本书包含了常用的Windows」· PAS 代码 · 共 65 行

PAS
65
字号
unit DLLAboutForm;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
  Buttons, ExtCtrls;

type
  TAboutBox = class(TForm)
    Panel1: TPanel;
    ProgramIcon: TImage;
    ProductName: TLabel;
    Version: TLabel;
    Copyright: TLabel;
    OKButton: TButton;
    Panel2: TPanel;
    Comments: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  {the exported prototype for displaying the about box}
  function ShowAboutBox(DLLHandle: THandle; ExampleName,
                        Comments: ShortString): Boolean; export;

var
  AboutBox: TAboutBox;

implementation

{$R *.DFM}

function ShowAboutBox(DLLHandle: THandle; ExampleName,
                        Comments: ShortString): Boolean;
begin
  {initialize the result value}
  Result := FALSE;

  {create the about box form}
  AboutBox := TAboutBox.Create(Application);

  {initialize the labels with the strings passed in}
  AboutBox.ProductName.Caption := ExampleName;
  AboutBox.Comments.Caption := Comments;

  {display a modal about box}
  AboutBox.ShowModal;

  {release the form}
  AboutBox.Release;

  {free the DLL and exit the thread from which it was called}
  FreeLibraryAndExitThread(DLLHandle, 12345);
  
  {indicate that the function completed}
  Result := TRUE;
end;



end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?