
20.08.2009, 10:31
|
Активный
|
|
Регистрация: 29.03.2009
Сообщения: 300
Репутация: 94
|
|
Непонятно, причем здесь CheckBox (в названии темы).
Можно, в принципе, по-разному. И не трогать опции проекта. Вот, например, модифицированный примерчик из справочной системы Delphi:
Главная форма:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMSHOWWINDOW(var Msg: TMessage); message WM_SHOWWINDOW;
public
{ Public declarations }
end;
var
Form1: TForm1;
Startup: Boolean;
implementation
uses AboutBox;
{$R *.dfm}
procedure TForm1.WMSHOWWINDOW(var Msg: TMessage);
begin
if Startup then
begin
Msg.WParam := 0;
Startup := False;
Form2.ShowModal;
end;
end;
initialization
Startup := True;
end.
Модуль с окном AboutBox:
Код:
unit AboutBox;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if not IsWindowVisible(Form1.Handle) then
SendMessage(Form1.Handle, WM_SHOWWINDOW, 1, 0);
end;
end.
|