wmi = new ActiveXComponent("WbemScripting.SWbemLocator");
// no connection parameters means to connect to the local machine
Variant conRet = wmi.invoke("ConnectServer");
// the author liked the ActiveXComponent api style over the Dispatch
// style
ActiveXComponent wmiconnect = new ActiveXComponent(conRet.toDispatch());
// the WMI supports a query language.
String query = "select CategoryString, Message, TimeGenerated, User, Type "
+ "from Win32_NtLogEvent "
+ "where Logfile = 'Application' and TimeGenerated > '20070915000000.000000-***'";