En  Fa
Discovering: Tips & Tricks  > Languages  > Delphi Tips  > Is a windows service installed with delphi
 
 

Is a windows service installed with delphi

   

Is a windows service installed with delphi

Description

Add WinSvc to uses then use this code.

Delphi code

procedure TForm1.Button1Click(Sender: TObject);
var
  SCManHandle, SvcHandle: THandle;
begin
  SCManHandle := OpenSCManager('Your_Machine_Name', nil, SC_MANAGER_CONNECT);

  if (SCManHandle > 0) then
    SvcHandle := OpenService(SCManHandle, 'Service_Name', SERVICE_QUERY_STATUS);

  if SvcHandle > 0 then //is service installed then .....
  //...

   CloseServiceHandle(SvcHandle);
end;
Details
      
Writer: Salar Khalilzadeh
Date Sent: 11/20/2008 10:45 AM
Views: 888
Votes: 0
Rating:   from Not Rated

Your Rating:

bookmark this
 

There is no comment for this topic.
Language:

Copyright © 2009 SoftProjects.org | About | Valid XHTML | CSS