查一查API书,网上也能查询API信息

解决方案 »

  1.   

    采用NT的net命令,请看我的例子。采用Socket联接的Internet应用服务器安装完后启动服务。
    @ECHO Please wait while starting Borland Socket Server...
    NET START "Borland Socket Server"
    @ECHO Please wait while starting UNIDA Decision MIDAS Service...
    NET START "UNIDA Decision MIDAS Service"停止服务并移除服务注册:
    @ECHO Please wait while stoping UNIDA Decision MIDAS Service...
    NET STOP "UNIDA Decision MIDAS Service"
    @ECHO Please wait while stoping Borland Socket Server...
    NET STOP "Borland Socket Server"
    @ECHO Please wait while uninstall UNIDA Decision MIDAS Service...
    UService -uninstall
    @ECHO Please wait while uninstall Borland Socket Server...
    scktsrvr -uninstall即:
    NET START "服务名"
    NET STOP "服务名"
      

  2.   

    Uses WinSvc;
    procedure RunServiceExample;
    var
     HSCManager:Cardinal;
     tess:TEnumServiceStatus;
    cbBytesNeeded:DWORD;
    ServicesReturned:DWord;
    ss:TServiceStatus;
    hsc:Integer;
    beginHSCmanager:=OpenSCManager(nil,SERVICES_ACTIVE_DATABASE,SC_MANAGER_ALL_ACCESS);
    hsc:=OpenService(HSCManager,'Schedule',SERVICE_START or SERVICE_QUERY_STATUS);
    QueryServiceStatus(hsc,ss);
    if ss.dwCurrentState=SERVICE_RUNNING then ShowMessage('Schedule alread run')
     else
      Begin
       StartService(hsc,0,nil);
      End;
    CloseServiceHandle(hsc);
    CloseServiceHandle(HSCManager);end;