unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  protected
    procedure WMQueryEndSession(var Message :TWMQueryEndSession); message WM_QUERYENDSESSION;
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.WMQueryEndSession(var Message :TWMQueryEndSession);
begin
ShowMessage('Zamkniêcie sesji Windows zablokowane');
FlashWindow(Application.Handle,true);
Message.Result:=0;
end;

end.
