Hi Iain,
Take a look at
ACE[
^]
It has a very useful logging framework, including the ability to write log output to another console process - something that is very useful when you are working on windows services.
Under the $(ACE_ROOT)\examples\NT_Service you will find a very nice example illustrating both logging, and how the framework can be used to implment a windows service. The framework also has a very flexible mechanism for dealing with configuration files :)
To monitor a directory you can use
ReadDirectoryChangesW[
^] - this the windows api implmenting the functionality used by the
System.IO.FileSystemWatcher
class mentioned by SAKryukov
Update
Leave your working executable as is, and use
CreateProcess[
^] from a simple windows service, passing a
STARTUPINFO[
^] with valid handles for hStdOutput and hStdError.
Use
CreateFile[
^] to create the handles hStdOutput and hStdError, this will cause your existing program to write to those handles for stdout and stderr, respectively.
Use CreateEvent to create an event object to set during the stop event and monitor the process handle and the event to determine when to stop your program.
You can read more about Windows services
here[
^]
Regards
Espen Harlinn