STARTUPINFO
The STARTUPINFO structure is used with the CreateProcess function to specify main
window properties if a new window is created for the new process. For graphical
user interface (GUI) processes, this information affects the first window created
by the CreateWindow function and shown by the ShowWindow function. For console
processes, this information affects the console window if a new console is created
for the process.

DuplicateHandle
The DuplicateHandle function duplicates an object handle. The duplicate handle refers
to the same object as the original handle. Therefore, any changes to the object are
reflected through both handles.DuplicateHandle can be called by either the source
process or the target process. It can also be invoked where the source and target
process are the same. Note that DuplicateHandle should not be used to duplicate
handles to I/O completion ports.

监护程序的编写
  win9X -> 编写console 程序
           createpipe()
           DuplicateHandle()
           CreateProcess()获得console的输入,输出handle

   windoww2000 xp
           OpenSCManager()
           OpenService()
           ControlService()
           QueryServiceStatus()
           StartService()
          
守护程序的编写:对长时间远行程序的监控,非正常退出时,重新运行服务。