?? 列表5.13.txt
字號:
【列表5.13】GetPID 程序代碼。
{
frmGetPID - Get and display summary information for this process
}
unit frmGetPID;
interface
uses
SysUtils, Types, Classes. QGraphics, QControls, QForms. QDialogs, Libc,
QStdCtrls;
type
TGetPIDMainForm = class(TForm)
InfoMemo: TMemo;
InfoBtn: TButton;
ExitBtn: TButton;
Label1: TLabel;
procedure ExitBtnClick(Sender: TObject);
procedure InfoBtnClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
GetPIDMainForm: TGetPIDMainForm;
implementation
{SR *.xfm}
procedure TGetPIDMainForm. ExitBtnClick(Sender: TObject);
begin
Close;
end;
procedure TGetPIDMainForm. InfoBtnClick(Sender: TObject);
var
p : PChar;
PPWRec : PPasswordRecord;
pid : Integer;
uid : Integer;
ppid : Integer;
pgroup : Integer;
ppgroup : Integer;
begin
pid := getpid;
uid := getuid;
ppid :: getppid;
pgroup := getpgid(pid);
ppgroup := getpgid(ppid);
PPWRec := getpwuid(uid);
p := PPWRec^.pw_name;
with InfoMemo. Lines do
begin
Clear;
Add(' User information:');
Add(' Login name: ' + p);
Add(' User ID: ' + IntToStr(uid));
Add('');
Add(' Current process:');
Add(' Process ID: ' + IntToStr(pid));
Add(' Group ID: ' + IntToStr(pgroup));
Add('');
Add(' Parent of current process:');
Add(' Process ID: ' + IntToStr(ppid));
Add(' Group ID: ' + IntToStr(ppgroup));
end; { with }
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -