home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, AppEx, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- AppEx: TAppEx;
- lLastCompiled: TLabel;
- lLastDesigned: TLabel;
- cbShowOnTaskBar: TCheckBox;
- cbHidefromCtrlAltDel: TCheckBox;
- Button1: TButton;
- Label1: TLabel;
- procedure FormShow(Sender: TObject);
- procedure AppExDisplayChanged(Sender: TObject; HorzRes, VertRes,
- ColorDepth: Integer);
- procedure AppExUserChanged(Sender: TObject);
- procedure AppExEndSession(Sender: TObject; var EndSession: Boolean);
- procedure cbShowOnTaskBarClick(Sender: TObject);
- procedure cbHidefromCtrlAltDelClick(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure AppExHotKey(Sender: TObject; Index: Integer);
- private
- HotKey : tHotKeyitem;
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FormShow(Sender: TObject);
- begin
- lLastCompiled.Caption:=Format('Last Compiled : %s',[DateTimeToStr(AppEx.LastCompileDate)]);
- lLastDesigned.Caption:=Format('Last Designed : %s',[DateTimeToStr(AppEx.LastDesignDate)]);
- end;
-
- procedure TForm1.AppExDisplayChanged(Sender: TObject; HorzRes, VertRes,
- ColorDepth: Integer);
- begin
- ShowMessage(Format('New Display Resolution %d x %d - %d',[HorzRes,VertRes,ColorDepth]));
- end;
-
- procedure TForm1.AppExUserChanged(Sender: TObject);
- begin
- ShowMessage('User Changed');
- end;
-
- procedure TForm1.AppExEndSession(Sender: TObject; var EndSession: Boolean);
- begin
- ShowMessage('Shutdown ? NO WAY!');
- EndSession:=False;
- end;
-
- procedure TForm1.cbShowOnTaskBarClick(Sender: TObject);
- begin
- AppEx.ShowOnTaskBar:=(Sender as TCheckBox).Checked;
- end;
-
- procedure TForm1.cbHidefromCtrlAltDelClick(Sender: TObject);
- begin
- AppEx.Process.ServiceProcess:=(Sender as TCheckBox).Checked;
- end;
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- ShowMessage(Format('FileDescription : %s'+#13#10+
- 'FileVersion : %s'+#13#10+
- 'CompanyName : %s'+#13#10+
- 'Copyright : %s'+#13#10,
- [AppEx.VersionInfo.FileDescription,
- AppEx.VersionInfo.FileVersion,
- AppEx.VersionInfo.CompanyName,
- AppEx.VersionInfo.Copyright]));
-
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- HotKey.Modifiers:=[hkCtrl,hkAlt];
- HotKey.VirtKey:=vkA;
- AppEx.HotKey.Add(HotKey);
- end;
-
- procedure TForm1.AppExHotKey(Sender: TObject; Index: Integer);
- begin
- Beep;
- ShowMessage('Hello World !');
- end;
-
- end.
-