後台監控軟件
一
目的是在任務列表中把程序隱藏起來
二
步驟
procedure WMHotKey(var Msg : TWMHotKey); message WM_HOTKEY;
三
unit Unit
interface
uses
Windows
type
TForm
Button
Button
procedure FormCreate(Sender: TObject);
procedure Button
procedure Button
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{熱鍵標識ID}
id: Integer;
procedure WMHotKey(var Msg : TWMHotKey); message WM_HOTKEY;
{ Privat
public
{ Public
end;
var
Form
implementation
const RSP_SIMPLE_SERVICE=
function RegisterServiceProcess (dwProcessID
{$R *
{捕獲熱鍵消息}
procedure TForm
begin
if msg
ShowMessage(
form
end;
procedure TForm
Const
{ALT
MOD_ALT =
MOD_CONTROL =
VK_R =
begin
{首先判斷程序是否已經運行}
if GlobalFindAtom(
begin
{注冊全局熱鍵Ctrl + Alt + R}
id:=GlobalAddAtom(
RegisterHotKey(handle
end
else
halt;
end;
{把當前進程變為一個系統服務
procedure TForm
begin
RegisterServiceProcess(GetCurrentProcessID
form
end;
procedure TForm
begin
close;
end;
{退出時釋放全局熱鍵}
procedure TForm
begin
UnRegisterHotKey(handle
GlobalDeleteAtom(id);
end;
end
四
在後台監控軟件中使用以上功能
From:http://tw.wingwit.com/Article/program/Delphi/201311/25039.html