这个问题2000分,地址冲突(300分)

  • 主题发起人 主题发起人 xeb
  • 开始时间 开始时间
X

xeb

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button5Click(Sender: TObject);<br>var<br> svcmgr,svc &nbsp;: &nbsp;Integer &nbsp;;<br> lpqscBuf: _QUERY_SERVICE_CONFIG;<br> dwBytesNeeded :DWORD;<br>begin<br> &nbsp; lpqscBuf :=new( _QUERY_SERVICE_CONFIG);<br> &nbsp; svcmgr &nbsp;:=OpenSCManager(nil,nil,SC_MANAGER_ALL_ACCESS);<br> &nbsp; if &nbsp;svcmgr &nbsp;= &nbsp; &nbsp; &nbsp;0 &nbsp;then<br> &nbsp; &nbsp; exit &nbsp;;<br> &nbsp; svc &nbsp;:=OpenService(svcmgr,<br> &nbsp; &nbsp; 'dhcp',SERVICE_ALL_ACCESS);<br> &nbsp; if &nbsp;svc &nbsp;= &nbsp;0 &nbsp;then<br> &nbsp; begin<br> &nbsp; &nbsp; &nbsp; &nbsp; CloseServiceHandle(svcmgr);<br> &nbsp; &nbsp; &nbsp; &nbsp; exit &nbsp;;<br> &nbsp; end &nbsp;;<br> &nbsp; if QueryServiceConfig(<br> &nbsp; &nbsp; &nbsp; &nbsp;svc,<br> &nbsp; &nbsp; &nbsp; &nbsp;@lpqscBuf,<br> &nbsp; &nbsp; &nbsp; &nbsp;4096,<br> &nbsp; &nbsp; &nbsp; &nbsp;dwBytesNeeded) then<br> &nbsp; begin<br> &nbsp; &nbsp; if lpqscBuf.dwStartType &gt;3 then<br> &nbsp; &nbsp; begin<br> &nbsp; &nbsp; &nbsp; showMessage('OK!');<br> &nbsp; &nbsp; end;<br> &nbsp; end;<br> &nbsp; CloseServiceHandle(svcmgr);<br> &nbsp; CloseServiceHandle(svc);<br>end;
 
给你一段参考代码<br>function TServiceInfoList.GetServiceConfig(<br> &nbsp;const AServiceInfo: TServiceInfo): Boolean;<br>var<br> &nbsp;dwTemp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: DWORD;<br> &nbsp;pCfg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: PQueryServiceConfig;<br>begin<br> &nbsp;Result &nbsp;:= &nbsp;False;<br> &nbsp;OpenHandle;<br> &nbsp;AServiceInfo.OpenHandle;<br> &nbsp;pCfg &nbsp; &nbsp;:= &nbsp;nil;<br> &nbsp;dwTemp &nbsp;:= &nbsp;0;<br> &nbsp;if AServiceInfo.FServiceHandle &gt; 0 then<br> &nbsp;try<br> &nbsp; &nbsp;QueryServiceConfig(<br> &nbsp; &nbsp; &nbsp; &nbsp;AServiceInfo.FServiceHandle,<br> &nbsp; &nbsp; &nbsp; &nbsp;pCfg,<br> &nbsp; &nbsp; &nbsp; &nbsp;0,<br> &nbsp; &nbsp; &nbsp; &nbsp;dwTemp);<br> &nbsp; &nbsp;if dwTemp &gt; 0 then<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;GetMem(pCfg, dwTemp);<br> &nbsp; &nbsp; &nbsp;try<br> &nbsp; &nbsp; &nbsp; &nbsp;if QueryServiceConfig(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AServiceInfo.FServiceHandle,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pCfg,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwTemp,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwTemp) then<br> &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AServiceInfo.FFileName &nbsp;:= &nbsp;pCfg.lpBinaryPathName;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AServiceInfo.FStartType := &nbsp;pCfg.dwStartType;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Result &nbsp;:= &nbsp;True;<br> &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;finally<br> &nbsp; &nbsp; &nbsp; &nbsp;FreeMem(pCfg);<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp;end;<br> &nbsp;finally<br> &nbsp; &nbsp;AServiceInfo.CloseHandle;<br> &nbsp;end;<br>end;
 
{<br>======================================================================<br>Project &nbsp;: Firebird utilities<br>Unit &nbsp; &nbsp; : uService.pas<br>Purpose &nbsp;: Access the windows NT service manager API<br>Author &nbsp; : Achim Kalwa &lt;delphi@achim-kalwa.de&gt;<br>Compiler : Borland Delphi 5.01<br>----------------------------------------------------------------------<br>Historie:<br>2002-03-04, Kalwa:<br>- Form/Unit created<br><br>2002-03-17, Kalwa:<br>- BUGFIX: In DoQueryServiceStatus, DoChangeServiceConfig,<br> &nbsp;the memory allocated for PServiceConfig was never freed.<br>======================================================================<br>}<br>//{$I fbmgr.inc}<br>unit uService;<br><br>interface<br><br>uses<br> &nbsp;SysUtils,<br> &nbsp;Windows,<br> &nbsp;WinSvc;<br><br>type<br> &nbsp;TSvcStatus = (ssUnknown, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// enumeration of service status<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssStopped,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssStartPending,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssStopPending,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssRunning,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssContinuePending,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssPausePending,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssPaused,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ssError);<br><br>function GetWinSysDir : String;<br>function GetServiceStatus(ServiceName : String) : TSvcStatus;<br>function DoStartService(ServiceName : string) : TSvcStatus;<br>function DoStopService(ServiceName : string) : TSvcStatus;<br>function DoChangeServiceConfig(ServiceName : string; Enabled, AutoStart : Boolean) : Boolean;<br>function DoQueryServiceConfig(ServiceName : string; var DisplayName : string; var Enabled, AutoStart : Boolean) : Boolean;<br><br>implementation<br><br>uses<br> &nbsp;Controls,<br> &nbsp;Forms;<br><br>function GetWinSysDir : String;<br>var<br> &nbsp;aLen &nbsp; : Integer;<br>begin<br> &nbsp;SetLength(Result, MAX_PATH);<br> &nbsp;aLen := Windows.GetSystemDirectory(PChar(Result), MAX_PATH);<br> &nbsp;SetLength(Result, aLen);<br>end;<br><br>function GetServiceStatus(ServiceName : String) : TSvcStatus;<br>{ retrieve status of given service }<br>var<br> &nbsp;dwStatus &nbsp; &nbsp; &nbsp; &nbsp; : DWord;<br> &nbsp;hService &nbsp; &nbsp; &nbsp; &nbsp; : SC_HANDLE;<br> &nbsp;hServiceManager &nbsp;: SC_HANDLE;<br> &nbsp;ServiceStatus &nbsp; &nbsp;: TServiceStatus;<br>Begin<br> &nbsp;dwStatus := 0 ;<br> &nbsp;hServiceManager := OpenSCManager(nil, nil, SC_MANAGER_CONNECT);<br><br> &nbsp;if hServiceManager &gt; 0 then begin<br> &nbsp; &nbsp;hService := OpenService(hServiceManager,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pChar(ServiceName),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_QUERY_STATUS);<br> &nbsp; &nbsp;if hService &gt; 0 then begin<br> &nbsp; &nbsp; &nbsp;if QueryServiceStatus(hService, ServiceStatus) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;dwStatus := ServiceStatus.dwCurrentState;<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;CloseServiceHandle(hService) ;<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;CloseServiceHandle(hServiceManager) ;<br> &nbsp;Result := TSvcStatus(dwStatus);<br>end; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ GetServiceStatus }<br><br>function DoStartService(ServiceName : string) : TSvcStatus;<br>{ start a installed service by name. Returns the service status }<br>var<br> &nbsp;hService &nbsp; &nbsp; &nbsp; &nbsp; : SC_HANDLE;<br> &nbsp;hServiceManager &nbsp;: SC_HANDLE;<br> &nbsp;pDummy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : PChar;<br> &nbsp;Tries &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Integer;<br>begin<br> &nbsp;Result := GetServiceStatus(ServiceName);<br> &nbsp;if Result &lt;&gt; ssStopped then Exit;<br><br> &nbsp;Screen.Cursor := crHourGlass;<br> &nbsp;hServiceManager := OpenSCManager(nil, nil, SC_MANAGER_CONNECT);<br><br> &nbsp;if hServiceManager &gt; 0 then begin<br> &nbsp; &nbsp;hService := OpenService(hServiceManager,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PChar(ServiceName),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_START);<br> &nbsp; &nbsp;if hService &gt; 0 then begin<br> &nbsp; &nbsp; &nbsp;pDummy := nil;<br> &nbsp; &nbsp; &nbsp;if StartService(hService, 0, pDummy) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;Tries := 10;<br> &nbsp; &nbsp; &nbsp; &nbsp;repeat<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sleep(1000);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Result := GetServiceStatus(ServiceName);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dec(Tries);<br> &nbsp; &nbsp; &nbsp; &nbsp;until (Tries = 0) or (Result = ssRunning);<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;else begin<br> &nbsp; &nbsp; &nbsp; &nbsp;Result := ssError;<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;CloseServiceHandle(hService);<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;CloseServiceHandle(hServiceManager);<br> &nbsp;Screen.Cursor := crDefault;<br>end; { DoStartService }<br><br>function DoStopService(ServiceName : string) : TSvcStatus;<br>{ stop a running service by name. Returns the service status }<br>var<br> &nbsp;hService &nbsp; &nbsp; &nbsp; &nbsp; : SC_HANDLE;<br> &nbsp;hServiceManager &nbsp;: SC_HANDLE;<br> &nbsp;ServiceStatus &nbsp; &nbsp;: TServiceStatus;<br> &nbsp;Tries &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Integer;<br>begin<br> &nbsp;Result := GetServiceStatus(ServiceName);<br> &nbsp;if Result &lt;&gt; ssRunning then Exit;<br><br> &nbsp;Screen.Cursor := crHourGlass;<br> &nbsp;hServiceManager := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);<br> &nbsp;if hServiceManager &gt; 0 then begin<br> &nbsp; &nbsp;hService := OpenService(hServiceManager,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PChar(ServiceName),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GENERIC_EXECUTE);<br> &nbsp; &nbsp;if hService &gt; 0 then begin<br> &nbsp; &nbsp; &nbsp;if ControlService(hService, SERVICE_CONTROL_STOP, ServiceStatus) then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;Tries := 10;<br> &nbsp; &nbsp; &nbsp; &nbsp;Repeat<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sleep(1000);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dec(Tries);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Result := GetServiceStatus(ServiceName);<br> &nbsp; &nbsp; &nbsp; &nbsp;until (Tries = 0) or (Result = ssStopped);<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp;Result := ssError;<br><br> &nbsp; &nbsp; &nbsp;CloseServiceHandle(hService);<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;CloseServiceHandle(hServiceManager) ;<br> &nbsp;Screen.Cursor := crDefault;<br>end; &nbsp; { DoStopService }<br><br>function DoQueryServiceConfig(ServiceName : string; var DisplayName : string; var Enabled, AutoStart : Boolean) : Boolean;<br>{ retrieves information for a named service. }<br>var<br> &nbsp;hService &nbsp; &nbsp; &nbsp; &nbsp; : SC_HANDLE;<br> &nbsp;hServiceManager &nbsp;: SC_HANDLE;<br> &nbsp;BytesNeeded &nbsp; &nbsp; &nbsp;: DWORD;<br> &nbsp;PServiceConfig &nbsp; : PQueryServiceConfig;<br>begin<br> &nbsp;Result := False;<br> &nbsp;DisplayName := '';<br> &nbsp;Enabled &nbsp; &nbsp; := False;<br> &nbsp;AutoStart &nbsp; := False;<br> &nbsp;hServiceManager := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);<br> &nbsp;if hServiceManager &gt; 0 then begin<br> &nbsp; &nbsp;hService := OpenService(hServiceManager,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PChar(ServiceName),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_QUERY_CONFIG or SERVICE_CHANGE_CONFIG);<br> &nbsp; &nbsp;if hService &gt; 0 then begin<br> &nbsp; &nbsp; &nbsp;BytesNeeded := 0;<br> &nbsp; &nbsp; &nbsp;QueryServiceConfig(hService, nil, 0, BytesNeeded);<br> &nbsp; &nbsp; &nbsp;GetMem(PServiceConfig, BytesNeeded);<br> &nbsp; &nbsp; &nbsp;QueryServiceConfig(hService, PServiceConfig, BytesNeeded, BytesNeeded);<br> &nbsp; &nbsp; &nbsp;DisplayName := StrPas(PServiceConfig^.lpDisplayName);<br> &nbsp; &nbsp; &nbsp;case PServiceConfig^.dwStartType of<br> &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_AUTO_START:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Enabled := True;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AutoStart := True;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_DEMAND_START:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Enabled := True;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AutoStart := False;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_DISABLED:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Enabled := False;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AutoStart := False;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp; &nbsp;end; { case }<br> &nbsp; &nbsp; &nbsp;CloseServiceHandle(hService);<br> &nbsp; &nbsp; &nbsp;FreeMem(PServiceConfig);<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;CloseServiceHandle(hServiceManager) ;<br> &nbsp;Screen.Cursor := crDefault;<br>end; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ DoQueryServiceStatus }<br><br>function DoChangeServiceConfig(ServiceName : string; Enabled, AutoStart : Boolean) : Boolean;<br>{ changes a service's statup configuration } <br>var<br> &nbsp;hService &nbsp; &nbsp; &nbsp; &nbsp; : SC_HANDLE;<br> &nbsp;hServiceManager &nbsp;: SC_HANDLE;<br> &nbsp;NewStartType &nbsp; &nbsp; : Integer;<br> &nbsp;DisplayName &nbsp; &nbsp; &nbsp;: string;<br> &nbsp;BytesNeeded &nbsp; &nbsp; &nbsp;: DWORD;<br> &nbsp;PServiceConfig &nbsp; : PQueryServiceConfig;<br><br>begin<br> &nbsp;Result := False;<br> &nbsp;hServiceManager := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);<br> &nbsp;if hServiceManager &gt; 0 then begin<br> &nbsp; &nbsp;hService := OpenService(hServiceManager,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PChar(ServiceName),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_QUERY_CONFIG or SERVICE_CHANGE_CONFIG);<br> &nbsp; &nbsp;if hService &gt; 0 then begin<br> &nbsp; &nbsp; &nbsp;BytesNeeded := 0;<br> &nbsp; &nbsp; &nbsp;QueryServiceConfig(hService, nil, 0, BytesNeeded);<br> &nbsp; &nbsp; &nbsp;GetMem(PServiceConfig, BytesNeeded);<br> &nbsp; &nbsp; &nbsp;QueryServiceConfig(hService, PServiceConfig, BytesNeeded, BytesNeeded);<br> &nbsp; &nbsp; &nbsp;DisplayName := StrPas(PServiceConfig^.lpDisplayName);<br> &nbsp; &nbsp; &nbsp;if Enabled then begin<br> &nbsp; &nbsp; &nbsp; &nbsp;if AutoStart<br> &nbsp; &nbsp; &nbsp; &nbsp;then NewStartType := SERVICE_AUTO_START<br> &nbsp; &nbsp; &nbsp; &nbsp;else NewStartType := SERVICE_DEMAND_START;<br> &nbsp; &nbsp; &nbsp;end<br> &nbsp; &nbsp; &nbsp;else<br> &nbsp; &nbsp; &nbsp; &nbsp;NewStartType := SERVICE_DISABLED;<br><br> &nbsp; &nbsp; &nbsp;Result := ChangeServiceConfig(<br> &nbsp; &nbsp; &nbsp; &nbsp;hService, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Handle of Service }<br> &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_NO_CHANGE, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change service type }<br> &nbsp; &nbsp; &nbsp; &nbsp;NewStartType, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set new start type }<br> &nbsp; &nbsp; &nbsp; &nbsp;SERVICE_NO_CHANGE, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change ErrorControl }<br> &nbsp; &nbsp; &nbsp; &nbsp;nil, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change BinaryPathName }<br> &nbsp; &nbsp; &nbsp; &nbsp;nil, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change LoadGroupOrder }<br> &nbsp; &nbsp; &nbsp; &nbsp;nil, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change dwTagID }<br> &nbsp; &nbsp; &nbsp; &nbsp;nil, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change Dependencies }<br> &nbsp; &nbsp; &nbsp; &nbsp;nil, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change ServiceStartName }<br> &nbsp; &nbsp; &nbsp; &nbsp;nil, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ don't change Password (if any) }<br> &nbsp; &nbsp; &nbsp; &nbsp;PChar(DisplayName)); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Display name }<br><br> &nbsp; &nbsp; &nbsp;CloseServiceHandle(hService);<br> &nbsp; &nbsp; &nbsp;FreeMem(PServiceConfig);<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;CloseServiceHandle(hServiceManager) ;<br> &nbsp;Screen.Cursor := crDefault;<br>end; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ DoChangeServiceConfig }<br><br>end.
 
路过,学习一下
 
学习一下
 
怎么才能给分<br>不能大于300?
 
感谢上面同志的热情解答
 
后退
顶部