Creating or emulating a windows service with a cinder app

Greetings All!

Working on a project wherein I have a main app that launches a Cinder app as a helper, and I’m at a stage where I’d like to clean things up a bit prior to distribution. Currently, the calling app that launches the Cinder app minimized, which works well enough, but at least for presentation purposes, I’d like to have it act a little more like a windows service. So two questions:

  1. Is there something built into Cinder to setup all the required framework to run as a windows service (SERVICE_TABLE_ENTRY, StartServiceCtrlDispatcher, etc)? If not, would it be sufficient to call it in setup or my prepareSettings function? Thinking not because of where all that stuff has to be done, but might as well ask.

  2. Alternately, is there something built into Cinder to make use of Shell_NotifyIcon and its friends(NOTIFYICONDATA, etc) to minimize the app to the notification area, or again, can I just call this directly in setup or some other spot?

Hi,

from what I know about Windows services, they can not have an interface (windows, dialogs), can not run as a stand-alone application and can not be debugged from within Visual Studio. These limitations alone make it impossible to run a standard Cinder application as a service.

I think you’ll be better off writing the application from scratch using the provided Visual Studio template for service applications. See: https://msdn.microsoft.com/en-us/library/d56de412(v=vs.110).aspx

I do think you could link against Cinder to use some of its functionality, but you can’t use anything related to App, Cairo, OpenGL, etc.

-Paul

Edit: you may want to have a look at service wrappers.

Thanks for the advice, from my limited research into services that’s about what I figured. Initially I was thinking it might not be the way to go since I do need OpenGL. Service Wrappers seem like a potential solution though, thanks for the tip!

Possibly not helpful since this was from Windows 7, but when a service launches a GUI app it launches it in a virtual desktop. The GUI app runs and can respond to network in/out but nothing is displayed. A quick google makes me think it’s still in use in windows 10.

Good to know for future reference, for now, I was able to solve my issue by just calling getWindow()->hide() since it doesn’t need to respond to any external inputs/messages or draw().