unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    procedure OnDwlKeyDown(Wnd: HWND; Down,Key,Shift: integer); {$IFNDEF CIL} stdcall; {$ENDIF}
  public
  end;

var
  Form1: TForm1;

implementation
uses
  dwlcore; 

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  wlSetObjKeyCallback(OnDwlKeyDown,kDownEvents); // Set callback function for Keydown Events
  wlDisableKey(0,VK_DELETE,MOD_CONTROL or MOD_ALT,1);
  wlDisableKey(0,MOD_ALL,MOD_ALL,1);
  Label1.Visible := true;
end;

procedure TForm1.OnDwlKeyDown(Wnd: HWND; Down, Key, Shift: integer);
begin
  if Key = VK_RBUTTON then
  begin
    wlDisableKey(0,0,0,0); // enable all Keys
    Label1.Visible := false;
  end;
end;
                              
procedure TForm1.FormDestroy(Sender: TObject);
begin
{$IFDEF CIL}
  wlExit; // normally not necessary,
          // but if you don't call this function the program crashes
          // on shutdown under Windows 98 if the program is compiled with
          // Delphi 8 .Net (VCL Framework) (may be a internal Delphi 8 problem)
{$ENDIF}

end;

end.
