If IsWindowVisible(next_hWnd) then
SGWindow.Cells[9, count + 1] := 'true'
else
SGWindow.Cells[9, count + 1] := 'false';
for j := 1 to 9 do
startWindow[j, count + 1] := SGWindow.Cells[j, count + 1];
sizeStartWindow := SGWindow.RowCount;
Inc(count);
SGWindow.RowCount := count + 1;
end;
next_hWnd := GetWindow (next_hWnd, GW_HWNDNEXT);
end;
//дочерние окна
LChildWindow.Caption := 'Список дочерних окон';
SGChildWindow.Cells[0, 0] := '№';
SGChildWindow.Cells[1, 0] := 'Дескриптор';
SGChildWindow.Cells[2, 0] := 'Заголовок';
SGChildWindow.Cells[3, 0] := 'Лево';
SGChildWindow.Cells[4, 0] := 'Верх';
SGChildWindow.Cells[5, 0] := 'Право';
SGChildWindow.Cells[6, 0] := 'Низ';
SGChildWindow.Cells[7, 0] := 'Род. процесс';
SGChildWindow.Cells[8, 0] := 'Род. поток';
SGChildWindow.Cells[9, 0] := 'Видимость';
//потоки, принадлежащие некому процессу
SGThread.Cells[0, 0] := '№';
SGThread.Cells[1, 0] := 'Родит. процесс';
SGThread.Cells[2, 0] := 'Идентификатор';
SGThread.Cells[3, 0] := 'Приоритет';
//Уничтожение процесса
LExitProcess.Caption := 'Введите ID или оставьте поле пустым и выберите процесс из списка:';
EExitProcess.Text := '';
//Изменение приоритета процесса
LPriorityProcess.Caption := 'Изменение приоритета процесса:';
RBRealtime.Caption := 'Наивысший';
RBHigh.Caption := 'Высокий';
RBNormal.Caption := 'Нормальный';
RBIdle.Caption := 'Низкий';
//Блокировка окон
LWindowBlock.Caption := 'Блокировка окон:';
RBWindowBlock.Caption := 'Блокировать';
RBNoWindowBlock.Caption := 'Разблокировать';
//Модули процесса
LModule.Caption := 'Модули процесса';
Mmodule.Lines.Clear;
CloseHandle(SH);
end;
procedure TForm1.SGProcessMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
count, n, i : Integer;
SH: Cardinal;
PME : TModuleEntry32;
begin
{вывод потоков}
SGProcess.MouseToCell(X, Y, ColProcess, RowProcess);
//очистка рабочей области таблицы
for count := 1 to SGThread.RowCount - 1 do
SGThread.Rows[count].Clear;
SGThread.RowCount := 2;
//если не строка с заголовками столбцов, то:
if RowProcess > 0 then
begin
n := 1;
for count := 1 to sizeStartThread do
if SGProcess.Cells[2, RowProcess] = startThread[1, count] then
begin
SGThread.Cells[0, n] := IntToStr(n);
for i := 1 to 3 do
SGThread.Cells[i, n] := startThread[i, count];
Inc(n);
SGThread.RowCount := n + 1;
end;
SGThread.RowCount := n;
end;
{вывод окон}
//очистка рабочей области таблицы
for count := 1 to SGWindow.RowCount - 1 do
SGWindow.Rows[count].Clear;
SGWindow.RowCount := 2;
//если не строка с заголовками столбцов, то:
if RowProcess > 0 then
begin
n := 1;
for count := 1 to sizeStartWindow do
if SGProcess.Cells[2, RowProcess] = startThread[1, count] then
begin
SGWindow.Cells[0, n] := IntToStr(n);
for i := 1 to 9 do
SGWindow.Cells[i, n] := startWindow[i, count];
Inc(n);
SGWindow.RowCount := n + 1;
end;
SGWindow.RowCount := n;
end;
//получение списка модулей
if RowProcess > 0 then
begin
Mmodule.Lines.Clear;
i := 1;
SH := CreateToolHelp32SnapShot(TH32CS_SnapMODULE, StrToInt(SGProcess.Cells[2, RowProcess]));
PME.dwSize := sizeof(ModuleEntry32);