title: How to enumerate and delete windows events?
body: <p>Windows events logs are usually stored in <code>%SystemRoot%\System32\winevt\Logs</code>. All files are some kind of databases, I want to ask how programmatically data could be enumed from <code>*.evt</code> and <code>*.evtx</code> files into separate records and how those records could be removed from the system.</p>
  
  <p>I have found <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa385784%28v=vs.85%29.aspx" rel="nofollow">Windows Event Log Functions</a>, however I'm looking for solution which works on XP. Latter on tried <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363654%28v=vs.85%29.aspx" rel="nofollow">Event Logging Functions</a>. Using this API I managed to read data as single records, however there is only one function for deletion, it is <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363637%28v=vs.85%29.aspx" rel="nofollow">ClearEventLog</a>. However this deletes all events from logs. I'm looking for solution where I could be able to delete single record.</p>
  
  <p><strong>Important note:</strong> I'm programming with C++ so C# and .net solutions aren't helpful, also I need to have compatibility with Windows-XP.</p>