[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

get services files

Posted on 2010-09-15
5
Medium Priority
?
368 Views
Last Modified: 2012-05-10
http://www.delphitricks.com/source-code/systeminfo/get_a_list_of_installed_services.html
that link pointed a list of services, i'd like to list there files also.
please
0
Comment
Question by:systan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:dr-evil
ID: 33688377
what is your problem?
u can't use code?
0
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 2000 total points
ID: 33688441
Use this function and pass in the service manage handle and the service name
ServiceFileName := GetServiceInformation(schm, StrPas(ssa^[j].lpServiceName))

function GetServiceInformation(const SCHandle: THandle; const AServiceName: string): string;
var
  ServiceHandle, StartType: THandle;
  Config: PQueryServiceConfig;
  Bytes_Needed: DWord;
begin
  Result := '';
  try
    ServiceHandle := OpenService(SCHandle,  PChar(AServiceName), SERVICE_QUERY_CONFIG);
    if ServiceHandle > 0 then
      try
        QueryServiceConfig(ServiceHandle, nil, 0, bytes_needed);
        GetMem(config, bytes_needed);
        try
          Win32Check(QueryServiceConfig(ServiceHandle, config, bytes_needed, bytes_needed));
          StartType := config.dwStartType;
          Result := config.lpBinaryPathName;
        finally
          FreeMem(config);
        end;
      finally
        CloseServiceHandle(ServiceHandle);
      end;
  except
  end;
end;
0
 
LVL 14

Author Closing Comment

by:systan
ID: 33688629
ewangoya;
Yes, its doned.

But, I want to ask,   why you know such like this kind of code?  do you have any reference that i could also see and understand more clearer?

Your not a magician I know, thats why I ask how did you know that?  Where did you get the code solution?  Is it because of your years of experience in codes like this?

How did you arrive in this area?

Because me?, I'm really having a hardtime programming with delphi,  but not vb.net and c#.NET.

lol, I'm sorry, but I already accepted your solution, its up to you to reply back or not.

Thanks
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 33697560
I suppose its just from a couple of years of experience I've had with Delphi.
I've come across lots of code on different projects. If you need refence for windows API, take a look at http://msdn.microsoft.com/en-us/library/
The codes are in C so you have to convert to equivalent delphi
0
 
LVL 14

Author Comment

by:systan
ID: 33698128
ah, ok, i see, so 1 man well experienced is better than any number of men when it comes programming.
I think you must have a masters rank also, you should grad it.

Thanks, seeya.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question