procedure write_win_event(chr:string); // 写windows事件日志
var
h:THandle;
ps:array[0..0] of PChar;
begin
if not record_winsys_log then exit;
h:=RegisterEventSource(nil,PChar(syscaption)); // 'Application'
ps[0]:=PChar(operid+'-'+oper+':'+chr); // 'simon测试写入windows系统日志';
if not ReportEvent(h,EVENTLOG_INFORMATION_TYPE,0{随便},10000{随便},nil,1,0,@ps,nil) then
RaiseLastWin32Error;
DeregisterEventSource(h);
end;