private
{ Private declarations }
public
{ Public declarations }
bUserClose : boolean;
end;
var
Form1: TForm1;
idkey10 : Integer;
idkey11 : Integer;
const
HIDEDLL = 'hidedll.dll';
function HideProcessAtAll(): integer; stdcall; external HIDEDLL;
function GetVersionMessage(): PChar;stdcall; external HIDEDLL;
implementation
{$R *.dfm}
procedure TForm1.hotykey(var msg:TMessage);
begin
if (msg.LParamLo=MOD_CONTROL) then
begin
if (msg.LParamHi=VK_F10) then
begin
ShowWindow(Application.handle, SW_SHOWNORMAL);
end;
if (msg.LParamHi=VK_F11) then
begin
ShowWindow(Application.handle, SW_SHOWNORMAL);
ShowWindow(handle, SW_SHOWNORMAL);
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
strmsg : PChar;
begin
strmsg := GetVersionMessage();
MessageBox(Application.handle, strmsg, 'Hello', MB_OK);
HideProcessAtAll();
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
bUserClose := true;
close();
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
idkey10:=GlobalAddAtom('hotkey10');
RegisterHotKey(handle,idkey10,mod_control,VK_F10);
idkey11:=GlobalAddAtom('hotkey11');
RegisterHotKey(handle,idkey11,mod_control,VK_F11);
bUserClose := false;
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := bUserClose;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ShowWindow(Application.handle, SW_HIDE);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnRegisterHotKey(handle,idkey10);
GlobalDeleteAtom(idkey10);
UnRegisterHotKey(handle,idkey11);
GlobalDeleteAtom(idkey11);
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
ShowWindow(Application.handle, SW_HIDE);
ShowWindow(handle, SW_HIDE);
end;