interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XPMan, ComCtrls, jpeg, ExtCtrls, Menus, ButtonComps;
type
TForm1 =
class(TForm)
Image1: TImage;
ImageButton1: TImageButton;
ImageButton2: TImageButton;
ImageButton3: TImageButton;
Bezeichnung: TEdit;
Aktion: TEdit;
Aktion2: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure ImageButton2Click(Sender: TObject);
procedure ImageButton1Click(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
procedure WMHotKey(
var msg: TMessage);
message WM_HOTKEY;
procedure WndProc(
var mymsg: TMessage);
override;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
const
MY_MENU_ID = 999;
procedure TForm1.WndProc(
var mymsg: TMessage);
var
hMenu : THandle;
begin
// Unnötige Systemmenü-Punkte entfernen
hMenu := GetSystemMenu(
Handle, False);
if hMenu <> 0
then
begin
if not DeleteMenu(hMenu, 6, MF_BYPOSITION)
then
ShowMessage(SysErrorMessage(GetLastError));
DrawMenuBar(hMenu);
end;
end;
// Auf die HotKeys reagieren
procedure TForm1.WMHotKey(
var msg: TMessage);
begin
Case msg.WParam
of
01: ShowMessage('
F1');
02: ShowMessage('
F2');
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// HotKeys registrieren
RegisterHotKey(
Handle,01,0,vk_F1);
RegisterHotKey(
Handle,02,0,vk_F2);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
// HotKeys wieder freigeben
UnregisterHotKey(
Handle,01);
UnregisterHotKey(
Handle,02);
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
Form1.Perform(WM_SYSCOMMAND, $F012, 0);
end;
procedure TForm1.ImageButton1Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TForm1.ImageButton2Click(Sender: TObject);
begin
Application.Minimize;
end;
end.