Функция для очистки логов Windows (Delphi)

procedure ClearWindowLogs;
var hnd: THandle;
begin
// System
hnd := OpenEventLog(nil, 'System');
if hnd <> 0 then
try
ClearEventLog(hnd, nil);
finally
CloseEventLog(hnd);
end;
// Application
hnd := OpenEventLog(nil, 'Application');
if hnd <> 0 then
try
ClearEventLog(hnd, nil);
finally
CloseEventLog(hnd);
end;
// Security
hnd := OpenEventLog(nil, 'Security');
if hnd <> 0 then
try
ClearEventLog(hnd, nil);
finally
CloseEventLog(hnd);
end;
end;

google.com bobrdobr.ru del.icio.us technorati.com linkstore.ru news2.ru rumarkz.ru memori.ru moemesto.ru

Tags: , ,

Leave a Reply