I'm trying to create a service that needs to execute an exe file. I'm trying to do this with ShellExecute and this works fine in a standard application, but not in a service application. The application is launched and appears under Processes in Task Manager but is not visible to the user. I wasn't sure what to pass to ShellExecute as the handle, so have been passing 0:
ShellExecute(0, 'open', PChar(RunCommand), PChar(RunParameters), PChar(ExtractFilePath(RunCommand)), SW_SHOWNORMAL);
I've messed about with various options so the service runs under the system account or a user account, but these options seem to make no difference.
If anyone could help with this, I'd really appreciate it as there seems to be little in the way of documentation for service applications.
Thanks very much in advance,