If you are writing applications to run as services under FireDaemon utilising the wxWidgets library, you may run into problems when the application is shut down by FireDaemon. The symptoms will be that FireDaemon kills off the application because it (apparently) does not respond to WM_CLOSE. This symptom is evident for any third party application attempting to shut down a wxWidgets based application.

The reason is that a wxWidgets application will only process the WM_CLOSE if the application itself has focus (which is not normally the case - especially if you are shutting down the service via the FireDaemon GUI). To make it work you will need to add the following code to your main window:

WXLRESULT MainFrm::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
   // For some reason wxWindows don't respond to WM_CLOSE
   // calls from outside the application (it seems the
   // application must have focus to process this message),
   // so we manually exit the application.
   if (message == WM_CLOSE)
   return wxFrame::MSWWindowProc(message, wParam, lParam);

Alternately, you could use a FireDaemon post service event that runs your own hand rolled program to locate the top level window of the application in question and then injects WM_ACTIVE followed by WM_CLOSE messages into the application's message queue.

Thanks to Rob at Net2Printer for tracking this down and providing the solution above. Net2Printer deploy FireDaemon OEM inside their Enterprise versions of their Net2Printer platform.