unit Unit83;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
CONST
UM_LOADPROJECT = WM_USER+10;
type
TForm83 = class(TForm)
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
procedure LoadProject(var Msg : TMsg); MESSAGE UM_LOADPROJECT;
procedure LoadProjectFile;
public
{ Public declarations }
end;
var
Form83: TForm83;
implementation
{$R *.dfm}
procedure TForm83.FormActivate(Sender: TObject);
begin
OnActivate:=NIL;
PostMessage(Handle,UM_LOADPROJECT,10,0)
end;
procedure TForm83.LoadProject(var Msg: TMsg);
begin
IF Msg.wParam>0 THEN
PostMessage(Handle,Msg.message,PRED(Msg.wParam),Msg.lParam)
ELSE
LoadProjectFile
end;
procedure TForm83.LoadProjectFile;
begin
// Do the project file load
end;
end.
FormActivate 的 PostMessage 中的“10”是将消息放到队列后面的次数。从值 0 开始以测试是否有必要。
Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号
执行时间: 0.047352075576782 seconds