This blog post has shown us how to enumerate the running processes and services. How about monitoring a particular process in your machine? How to identify the list of threads, modules, and handles associated with a particular process programmatically? Don’t know how to do it? Don’t worry. MiTec’s System Information Management Suite’s component helps to do that effectively, and we will learn how to use the thread TSysProcMonThread to demonstrate the process monitoring.
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 installs 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.3DemosDelphi18
- Open the PM project in RAD studio 10.4.1 compile and Run the application.
- This Demo App shows how to list down the running processes and its threads, handles, modules association for the selected process.
Components used in MSIC PM Demo App:
- TSysProcMonThread: Monitors system and provides running processes, CPU, memory and disk monitoring and provides system information.
- TListView for viewing running Process list.
- TPanel to show the Threads, Modules, Handles list information in a separate tab sheets for the selected process.
Implementation Details:
- An instance FSPM of TSysProcMonThread were created. And in regular interval of the thread, Process list refreshed and updated to the screen using the OnInterval Event handler. On each interval, the Process List is refreshed using RefreshProcList.
- On each interval, ThreadList, Modules List, Handles List is refreshed using procedures RefreshThreadList, RefreshModList, RefreshHandleList if a particular process is monitored.
In this way, you can monitor any process in your application effectively. Use this MiTeC component suite and get the job done quickly.
With the use of a Windows IDE, you can easily monitor the current Windows process in a Delphi app with a component suite. Try your Free Trial here.