您现在的位置:首页 >> API >> API >> 内容

Delphi向事件查看器中添加事件

时间:2011/9/3 14:52:38 点击:

  核心提示:{Error:1 Warn:2 Information:4 AuditSuccess:8 AuditFailure:16}procedure MyReportEvent(AMsg: String; A...
{Error:1 Warn:2 Information:4 AuditSuccess:8 AuditFailure:16}
procedure MyReportEvent(AMsg: String; AType: Word);
var
  h: THandle;
  pMsg: PChar;
begin
  h := 0;
  try
    try
      h := OpenEventLog(nil, 'Domain Mapper');
      pMsg := pChar(AMsg);
      ReportEvent(h, AType, 0, 0, nil, 1, 0, @pMsg, nil);
    except
    end;
  finally
    if h <> 0 then
      CloseEventLog(h);
  end;
end;

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