Remko Weijnen's Blog (Remko's Blog)

About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like

Get Process Id of a running Service

Sometimes you need to know the Process Id (PID) of a running service. Since Windows 2003 you can use the tasklist.exe tool with the /SVC switch. But how to do this programmatically?

The QueryServiceStatusEx API returns a SERVICE_STATUS_PROCESS structure that contains the PID.

The code is not very complicated:

  • Filed under: Delphi
  • Citrix Launcher Progress Update 1

    After figuring out how to encode and decode the Citrix passwords my next step for the upcoming Citrix Launcher is experiment with config.xml and authenticating to the Citrix Web Interface.

    imageI imported the NFuse.dtd from the Citrix Web Interface into Delphi with the XML Data Binding Wizard. The results in an NFuse Unit so I can easily create the XML data.

    To create an authentication packet I use the following code:


  • Filed under: Citrix, Delphi
  • Logon SIDToday I was reusing some old (pre vista) code the retrieves the Logon SID that I wrote a few years ago. The Logon SID is a special SID that identifies a logon session that has the form S-1-5-5-X-Y.

    You can view your Logon SID with Process Explorer, right click a GUI process, select Properties and goto the Security Tab:

    Process Explorer|Security Tab|Logon SID



    In my SATA Controller Identification tool I was using the TSaveDialog (Delphi 2010) but I got a report that under Windows PE the dialog is never shown.

    There’s no exception and I didn’t really bother to check why it fails. Instead I decided to replace it with the GetSaveFileName API which does work under Windows PE.


  • Filed under: Delphi
  • Donate