IntToStr (ji);
}> Strings [i] = procnames-> Strings [i]. SubString (1, procnames-> Strings [i]. Length () -4);
}
{(j = i +1; j Count && procnames-> Strings [i] == procnames-> Strings [j]; j + +)
{> Strings [j] = procnames-> Strings [j] + "#" + IntToStr (ji);
} (procnames-> Strings [i] == "[System Process]")> Strings [i] = "_Total";
}
} * pCounter; (i = 0; i Count; i + +)
{pro = procnames-> Strings [i]; (j = 0; j <7; j + +)
{= new s.c_str (), 0, pCounter); -> Objects [2 + j] [i +1] = (TObject *) pCounter;
}
}
} + +; _STATUS pdhStatus = 0; (hQuery); (i = 0; i Count; i + +)
{(j <7)
{(j == 6)
{(* (HCOUNTER *) (StringGrid1-> Objects [j] [i +1]), PDH_FMT_DOUBLE, 0, & fmtValue); -> Cells [j] [i + 1] = (unsigned long int) (fmtValue.doubleValue);
}
{= PdhGetFormattedCounterValue (* (HCOUNTER *) (StringGrid1-> Objects [j] [i +1]), PDH_FMT_DOUBLE, 0, & fmtValue); (pdhStatus == PDH_INVALID_DATA) p>
{(hQuery); (* (HCOUNTER *) (StringGrid1-> Objects [j] [i +1]), PDH_FMT_DOUBLE, 0, & fmtValue);
} -> Cells [j] [i +1] = fmtValue.doubleValue;
}
}
{(* (HCOUNTER *) (StringGrid1-> Objects [j] [i +1]), PDH_FMT_DOUBLE, 0, & fmtValue); -> Cells [j] [i + 1] = (unsigned long int) (fmtValue.doubleValue)/1024;
}
}
} -> RowCount = procnames-> Count + 1;
} __fastcall TForm1 :: StringGrid1SelectCell (TObject * Sender, int ACol, ARow, bool & CanSelect)
{= ARow;
} __fastcall TForm1 :: Button2Cl ick (TObject * Sender)
{();
} __fastcall TForm1 :: Button1Click (TObject * Sender)
{l; = StrToInt (StringGrid1-> Cells [2] [c]); = OpenProcess (PROCESS_TERMINATE, true, b); (l, 0); (l);
}
Додаток C
# include
# include
# include
# include
# include
# include
// # include
# include
# include
# pragma hdrstop
# include "Unit1.h"
# include "tlhelp32.h"