HP Xw460c Remote Graphics Software 5.3.0 User Guide - Page 172
monitorEventsEVENT_SERVER, EVENT_SRC, seconds, Remote Application Termination 172
View all HP Xw460c manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 172 highlights
// If an event is added, either the start or count will change. // Get the start and count. Microsoft does not specify what // reasons these functions could fail, so we cannot ensure // success. Check the return value. if (GetOldestEventLogRecord(h, &dwCurrentStart) == false || GetNumberOfEventLogRecords(h, &dwCurrentCount) == false) { CloseEventLog(h); ... report error - unable to obtain event logs ... return; } if (CloseEventLog(h) == false) { ... report error status here ... return; } // Determine state of log change Compute the index of the last event. If the count is zero, then // there are no events and the index is 0. if (dwCurrentCount == 0) { dwNewIndex = 0; } else { dwNewIndex = dwCurrentStart + dwCurrentCount - 1; } // If the new index is different than the current, update the current // and process the current event. Otherwise, we sleep for a while. if (dwNewIndex != dwCurrentIndex) { // We have at least one new event. Print out the last event. dwCurrentIndex = dwNewIndex; if (dwNewIndex) { if (processEvent(eventServer, eventSource, dwCurrentIndex)) { ... event processing error here ... return; } } } else { // No new events. Sleep for 1 second. Sleep(1000); waitedFor += 1; } } return; } main setup and initialize agent ... monitorEvents(EVENT_SERVER, EVENT_SRC, seconds); ... cleanup agent here or send alerts ... ... may wish to return status from monitorEvents ... } Remote Application Termination 172