See Win32::Service.
In reply to Re: communicate with a program running in the background by BrowserUk in thread communicate with a program running in the background by fionbarr