Sometimes developers want to list down or identify the process running on a machine programmatically. How do enumerate the running processes and services quickly? Don’t know what to do? Don’t worry. MiTec’s System Information Management Suite’s component helps to do that effectively, and we will learn how to use the threads TSysProcMonThread and TSvcListMonThread to demonstrate the processes and services, respectively.
Platforms: Windows.
Installation Steps:
You can easily install this Component Suite from GetIt Package Manager. The steps are as follows.
- Navigate In RAD Studio IDE->Tools->GetIt Package Manager->select Components in Categories->Components->Trail -MiTec system Information Component Suite 14.3 and click Install Button.
- Read the license and Click Agree All. An Information dialog saying ‘Requires a restart of RAD studio at the end of the process. Do you want to proceed? Click yes and continue.
- It will download the plugin and install it. Once installed, Click Restart now.
How to run the Demo app:
- Navigate to the System Information Management Suite trails setup, Demos folder which is installed during Get It installation e.g) C:UsersDocumentsEmbarcaderoStudio21.0CatalogRepositoryMiTeC-14.3DemosDelphi6
- Open the PV project in RAD studio 10.4.1 compile and Run the application.
- This Demo App shows how to list down the running Process and Services in your machine, enumerate among them and access its properties.
Components used in MSIC PV Demo App:
- TSysProcMonThread: Monitors system and provides running processes, CPU, memory and disk monitoring and provides system information.
- TSvcListMonThread: Monitors installed services and drivers in real-time and provides their properties.
- 2 TTabsheet’s one for viewing Process list in TListView and other for viewing Services in TListView .
- TButton to view the details of the process or service accordingly in a new child form.
Implementation Details:
- An instance SPM of TSysProcMonThread and SLM of TSvcListMonThread were created. And in regular interval of each thread the Process list and service list is refreshed and updated to the screen using the OnInterval Event handlers
- On each interval, the Process List( using TProcessRecord ) and Service List (using TServiceRecord) is added to the list view by clearing the existing list.
- Upon Clicking Details for the selected process in the list a new child form is created and data is added to different tab sheets.
Upon Clicking Details for the selected Service in the list a new child form is created and data is added to different tab sheets.
- Apart from these, stopping, starting, pausing, and resuming the services were implemented in the sample.
It’s that simple to enumerate the Process List and Service List running in your machine and view the details of the process. Use this MiTeC component suite and get the job done quickly.
With the use of Windows IDE, you can build your own windows process viewer when developing in Delphi or C++ environments. Try your Free Trial here.