unit helpers_class;
{$mode objfpc}{$H+}
{$modeswitch advancedrecords+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls,
LCLType, ExtCtrls, StdCtrls, Messages, LMessages;
Type
{ SISUtilHelperForms }
HelperForms = Class Helper For TForm
private
procedure WmSysCommand(var TheMessage: TLMessage);
public
procedure Catch_SC_MINIMIZE;
End;
implementation
var
OrgWindowProc:array of TWndMethod;
{ HelperForms }
procedure HelperForms.Catch_SC_MINIMIZE;
var
idx:integer;
begin
idx:=Length(OrgWindowProc);
SetLength(OrgWindowProc, idx+1);
OrgWindowProc[idx]:=WindowProc;
Tag:=idx;
WindowProc:=@WmSysCommand;
end;
procedure HelperForms.WmSysCommand(var TheMessage: TLMessage);
var
msg: TWMSysCommand absolute TheMessage;
Begin
If (msg.CmdType = SC_MINIMIZE) Then
ShowMessage('Application.Minimize');
OrgWindowProc[Tag](TheMessage);
//inherited;
End;
End.