0

I want to read events from the windows EventLog. I found two opportunities yet: WMI and API-Commands. But at the moment I use the JvNTEventLog componente from the JEDI VCL (JVCL) (Maybe it uses the API, I don't know). But I have some trouble with it. For example the the command "JvLog.EventRecord.Computer" should show me the computername. This works with the Security Log (says John-PC), but in the System Log and in the Application Log it's just empty. But instead the "JvLog.EventRecord.Source" which shows "uditing" in the Security Log shows my computername in the System Log, but cut off. Now it's "n-PC". Also I'm not able to read the "JvLog.EventRecord.Message". In the System and Application Log it's encrypted. The "JvLog.EventRecord.EventString" is also encrypted, band in the Security Log it looks just mixed and wired. So would it be easier to work directly with the API commands? Or should I use the WMI methode?

Thanks :)

Ken White
  • 123,280
  • 14
  • 225
  • 444
Timestop
  • 73
  • 1
  • 2
  • 8
  • Probably best and easiest way is to use WMI. [RRUZ](http://stackoverflow.com/users/91299/rruz) has created a very nice [WMI delphi Code Creator](http://theroadtodelphi.wordpress.com/wmi-delphi-code-creator) that will probably be of great help to you. – Peter Jul 06 '13 at 17:17
  • What Delphi version? What Windows version? What JVCL version? What does the debugger show you when you step through the source? – Ken White Jul 06 '13 at 17:29
  • @Ken: It's Delphi XE2 with JVCL 3.47 on Win7 Professional. – Timestop Jul 06 '13 at 17:59
  • Can you post the code you're using? Or the component properties? Or anything else that might be useful to try and help you? – Ken White Jul 06 '13 at 18:25
  • I'm new to stackoverflow. Are the tags to format my code? And how to make line breaks? – Timestop Jul 06 '13 at 18:50
  • Here's a link to the original JvNTEventLog.pas. I just uploaded it. I will also post the code I use to get the data from the component into an array. But at first i need to read, how to use the code-tags :D http://www.workupload.com/file/0fXgyzJ – Timestop Jul 06 '13 at 18:59
  • I can confirm this as a bug in the `TJvNTEventLog` component, at least in JVCL 3.45. It doesn't seem to work properly on Windows 7, especially wnen run with UAC enabled. You should probably report this to the folks at JEDI. – Ken White Jul 06 '13 at 19:06
  • Ok, thank you for your help :) I will report it and try some other ways like WMI. – Timestop Jul 06 '13 at 22:34

0 Answers0