larations_FMT_COUNTERVALUE fmtValue; computername [MAX_COMPUTERNAME_LENGTH]; long size; * procnames; ://User declarations
__fastcall TForm1 (TComponent * Owner); hQuery;
}; PACKAGE TForm1 * Form1;
# endif
Додаток Б
Код програми:
# include
# include
# include
# include
# include
# include
# include
# include
# include
# pragma hdrstop
# include "Unit1.h"
# include "tlhelp32.h"
# pragma package (smart_init)
# pragma resource "*. dfm" * Form1; b, c, i, j, a = 0; StrCounters [7] [30] = {"Ідентифікатор процесу",
"Базовий пріоритет",
"Лічильник потоків",
"Код (ID) створив процесу",
"% завантаженості процесора",
"Байт віртуальної пам'яті",
"Байт файлу підкачки"};
__fastcall TForm1 :: TForm1 (TComponent * Owner)
: TForm (Owner)
{= new TStringList; = MAX_COMPUTERNAME_LENGTH; -> Cells [0] [0] = "№"; -> Cells [1] [0] = "Ім'я потоків "; -> Cells [5] [0] =" PID батька "; -> Cells [6] [0] =" Загр. процесу "; -> Cells [7] [0] =" Вірт. пам'ять "; -> Cells [8] [0] =" Пам'ять підг. "; (computername, & size); (NULL, NULL, & hQuery);
} __fastcall TForm1 :: Timer1Timer (TObject * Sender)
{
{h; p;. dwSize = sizeof (PROCESSENTRY32); = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0); (a == 1)
{> Clear (); (j = 1; j RowCount); j + +)
{(i = 2; i <9; i + +)
}
}
} = 1; (Process32First (h, & p))
{
{> Add (p.szExeFile);
} (Process32Next (h, & p));
}> Sort (); (i = 0; i Count; i = j)
{name = procnames-> Strings [i]. SubString (procnames-> Strings [i]. Length () -2,3); (name == AnsiString ("exe" ) | | name == AnsiString ("EXE"))
{(j = i +1; j Count && procnames-> Strings [i] == procnames-> Strings [j]; j + +)
{> Strings [j] = procnames-> Strings [j]. SubString (1, procnames-> Strings [j]. Length () -4);> Strings [j ] = procnames-> Strings [j] + "#" +...