能介绍一下服务程序如何实现吗,可不可以给源码我学习一下。谢谢
[email protected]

解决方案 »

  1.   

    注册一个服务到服务管理器:
    Shell "C:\..\ServiceName.exe /Service" '/regServer
    从服务管理器上注销一个服务:
    Shell "C:\..\ServiceName.exe /UnregServer"
      

  2.   

    一定要给分啊!!说好了的, :)typedef DWORD(CALLBACK* LPFNDLLFUNC1)(DWORD,DWORD);HINSTANCE hKernelLib;
    LPFNDLLFUNC1 lpfnDllFunc1;    // Function pointer//装...    hKernelLib = LoadLibrary("kernel32.dll");
        if(hKernelLib)
        {
     lpfnDllFunc1 =(LPFNDLLFUNC1) GetProcAddress(hKernelLib,"RegisterServiceProcess");
             
     if(lpfnDllFunc1)
    lpfnDllFunc1(GetCurrentProcessId(),1);
        }//卸载...
     if(hKernelLib)
     {
         if(lpfnDllFunc1)lpfnDllFunc1(GetCurrentProcessId(),0);
               FreeLibrary(hKernelLib);
     }