|
From: Tom W. <tom...@ho...> - 2015-12-02 23:40:14
|
Hi,I have a Java application that uses Method 3.The service works perfectly fine in that it can be installed as a service without any problems.My application requires to perform actions on specific Windows events such as a user logging of, however when the service is running and I log out of the application the event is not received by the service.I know that application works and that it receives some events because when I run it in the command line and ctrl-c it, it gets the event 200. Why is the application not receiving the Windows events?(I log the activity of the events so can see what it picks up).public void controlEvent( int event ){ logger.info("Event: " + event); if(WrapperManager.isLaunchedAsService()) if(event == WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT) logger.info("User is logging off."); else if(event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT) logger.info("Windows system is shutting down."); else if(event == WrapperManager.SERVICE_CONTROL_CODE_SHUTDOWN) logger.info("System is shutting down.");}Thanks,Tom
|