Hide a process in the kill task menu

博客涉及Windows应用程序相关内容,包含菜单、终止应用等方面,与信息技术领域的Windows系统应用操作有关。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

注:此程序只能在WIN9X下运行,WINDOWS NT以下操作系统的KERNEL32.DLL文件已不包含API函数RegisterServiceProcess;
How can I hide my application in 
the Ctrl+Alt+Del menu? You need to 
use RegisterServiceProcess, which 
has to be imported from the kernel.
See the following example:


unit Unit1;

Interface

uses
  Windows, Messages, SysUtils, Classes, 
  Graphics, Controls, Forms, Dialogs,StdCtrls;

type
  TForm1 = class (TForm)
    Button1 : TButton;
    procedure FormDestroy (Sender: TObject);
    procedure FormCreate (Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1 : TForm1;

implementation

{$R *.DFM}

const
  RSPSIMPLESERVICE     = 1;
  RSPUNREGISTERSERVICE = 0;

function RegisterServiceProcess(dwProcessID, 
  dwType: DWord) : DWord; stdcall; 
  external 'KERNEL32.DLL';

procedure TForm1.FormDestroy(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID, 
                           RSPUNREGISTERSERVICE)
end;


procedure TForm1.FormCreate (Sender: TObject);
begin
  RegisterServiceProcess (GetCurrentProcessID, 
                            RSPSIMPLESERVICE)
end;


end.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值