Resides in an external DLL, named ntsrvts.dll in Release and ntsrvtsd.dll in Debug. Service installation is done via this dialog box. First button do the job, the 2nd dismiss dialog, and the 3rd browse for service executable file name. All the stuff is done by the CreateService system routine. But I think it's a good starting point.
Logged user is managed by the following method, OnLoggedUser .
It is a classical use of a type library, excel9.olb . In this DLL I have selected only Application , Font , Range , Workbooks , Workbook , Worksheets and Worksheet objects. Finally, the task scheduling. If you have already used IShellFolder browsing techniques, this will appear natural. For tasks folder and log file, the routine seek local computer.