您现在的位置:首页 >> 基础算法 >> window基础 >> 内容

Delphi中给Windows服务程序添加描述信息

时间:2011/9/3 15:31:37 点击:

  核心提示:procedureTMyService.ServiceAfterInstall(Sender:TService); var reg:TRegistry; begin reg:=TRegistry.Cr...
procedure TMyService.ServiceAfterInstall(Sender: TService);
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  try
    with reg do begin
      RootKey := HKEY_LOCAL_MACHINE;
      if OpenKey('SYSTEM\CurrentControlSet\Services\'+Name,false) then
begin
        WriteString('Description','This is the service description');
      end;
      CloseKey;
    end;
  finally
    reg.Free;
  end;
end;

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号