Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 22-09-2008
jocey jocey is offline
Miembro
 
Registrado: ene 2007
Posts: 111
Poder: 18
jocey Va por buen camino
Servicio con windows

en este si compila, pero el valor que le subrayo siempre esta en cero....

Código Delphi [-]
   procedure StartSrv(Nombre: String);
var
 ServiceControlManager: SC_HANDLE;
 Service: SC_HANDLE;
 ServiceStatus: SERVICE_STATUS;
 Argv: PChar;
begin
  ServiceControlManager:= OpenSCManager(nil, nil, SC_MANAGER_CONNECT);
  if ServiceControlManager <> 0 then
  begin
    Service:= OpenService(ServiceControlManager,PChar(Nombre),SERVICE_ALL_ACCESS);
    if Service <> 0 then
    begin
      if QueryServiceStatus(Service, ServiceStatus) then
      begin
        if ServiceStatus.dwCurrentState <> SERVICE_RUNNING  then
        begin
          Argv:= nil;
          StartService(Service,0,Argv);
        end;
      end;
      CloseServiceHandle(Service);
    end;
    CloseServiceHandle(ServiceControlManager);
  end;
end;

entonces nunca entra, sale al final de la aplicacion...
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Servicios de Windows Eklypsex API de Windows 3 31-10-2008 19:30:13
Listar los servicios instalados en Windows XP fide API de Windows 2 01-03-2008 17:05:11
programar servicios en WINDOWS-XP jesusid Servers 3 20-01-2007 02:25:32
Servicios en windows vista seoane Noticias 10 08-06-2006 02:52:35


La franja horaria es GMT +2. Ahora son las 04:51:31.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi