home *** CD-ROM | disk | FTP | other *** search
- unit EventForm;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, Buttons, StdCtrls, Menus;
-
- const
- ARE_CantExec = 1;
-
- type
- TEventForm1 = class(TForm)
- Panel1: TPanel;
- EventStaticText1: TStaticText;
- OKSpeedButton1: TSpeedButton;
- PopupMenu1: TPopupMenu;
- Close1: TMenuItem;
- procedure OnMoveOnScreen(Sender : TObject; Button : TMouseButton;
- Shift : TShiftState; X, Y : Integer);
- procedure FormKeyDown(Sender: TObject; var Key: Word;
- Shift: TShiftState);
- procedure Close1Click(Sender: TObject);
- procedure OKSpeedButton1Click(Sender: TObject);
- private
- { Private declarations }
- public
- procedure Execute(AEvent : Cardinal);
- end;
-
- var
- EventForm1: TEventForm1;
-
- implementation
-
- {$R *.DFM}
-
- const
- S_CantExec : String = 'AutoRun can''t execute selected item.';
-
- procedure TEventForm1.Execute(AEvent : Cardinal);
- begin
- case AEvent of
- ARE_CantExec:
- begin
- Caption := S_CantExec;
- EventStaticText1.Caption := S_CantExec;
- end;
- end;
- ShowModal;
- end;
-
- procedure TEventForm1.OnMoveOnScreen(Sender : TObject; Button : TMouseButton;
- Shift : TShiftState; X, Y : Integer);
- var
- Point : TPoint;
- begin
- If Button = mbLeft then
- begin
- Point.x := X;
- Point.y := Y;
- ReleaseCapture;
- SendMessage(Handle, wm_NCLButtonDown, htCaption, Integer(@Point));
- end;
- end;
-
- procedure TEventForm1.FormKeyDown(Sender: TObject; var Key: Word;
- Shift: TShiftState);
- begin
- case Key of
- VK_Return, VK_Space, VK_Escape:
- Close;
- end;
- end;
-
- procedure TEventForm1.Close1Click(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TEventForm1.OKSpeedButton1Click(Sender: TObject);
- begin
- Close;
- end;
-
- end.
-