核心提示:type TAutoPlayForm = class(TForm) chkNoAutoPlay: TCheckBox; procedure FormCreate(Sender: TObject) ;...
type
TAutoPlayForm = class(TForm)
chkNoAutoPlay: TCheckBox;
procedure FormCreate(Sender: TObject) ;
private
procedure WindowProcedure(var Msg : TMessage) ;
end;
var
AutoPlayForm: TAutoPlayForm;
Message_QueryCancelAutoPlay : Cardinal;
implementation
{$R *.dfm}
procedure TAutoPlayForm.WindowProcedure(var Msg: TMessage) ;
begin
if (Message_QueryCancelAutoPlay = Msg.Msg) then
begin
if chkNoAutoPlay.Checked then
Msg.Result := 1 //disable auto-play
else
Msg.Result := 0; //enable auto-play
end
else
inherited WndProc (Msg) ;
end;
procedure TAutoPlayForm.FormCreate(Sender: TObject) ;
begin
Self.WindowProc := WindowProcedure;
Message_QueryCancelAutoPlay := RegisterWindowMessage('QueryCancelAutoPlay') ;
end;