ProcListDlg.pas
上传用户:llfxmlw
上传日期:2009-09-14
资源大小:335k
文件大小:2k
- unit ProcListDlg;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls;
- type
- TProcListForm = class(TForm)
- Panel1: TPanel;
- ProcList: TListBox;
- CloseWinBut: TButton;
- KillBut: TButton;
- CancelBut: TButton;
- procedure CancelButClick(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure ProcListClick(Sender: TObject);
- procedure CloseWinButClick(Sender: TObject);
- procedure KillButClick(Sender: TObject);
- private
- { Private declarations }
- public
- procedure SetList(const Data: string);
- procedure EnableButs;
- end;
- var
- ProcListForm: TProcListForm;
- implementation
- uses ClientFrm, RemConMessages;
- {$R *.DFM}
- procedure TProcListForm.CancelButClick(Sender: TObject);
- begin
- Close;
- end;
- procedure TProcListForm.EnableButs;
- var
- b : boolean;
- begin
- b := ProcList.ItemIndex <> -1;
- CloseWinBut.Enabled := b;
- KillBut.Enabled := b;
- end;
- procedure TProcListForm.FormShow(Sender: TObject);
- begin
- EnableButs;
- end;
- procedure TProcListForm.ProcListClick(Sender: TObject);
- begin
- EnableButs;
- end;
- procedure TProcListForm.CloseWinButClick(Sender: TObject);
- begin
- with (Owner as TClientForm) do begin
- SendMsg(MSG_CLOSE_WIN, ProcList.Items[ProcList.ItemIndex], ClientSocket1.Socket);
- end;
- end;
- procedure TProcListForm.KillButClick(Sender: TObject);
- begin
- with (Owner as TClientForm) do begin
- SendMsg(MSG_KILL_WIN, ProcList.Items[ProcList.ItemIndex], ClientSocket1.Socket);
- end;
- end;
- procedure TProcListForm.SetList(const Data: string);
- var
- OldProc : string;
- begin
- OldProc := '';
- if ProcList.ItemIndex < ProcList.Items.Count then
- OldProc := ProcList.Items[ProcList.ItemIndex];
- ProcList.Items.Text := Data;
- if OldProc<>'' then
- ProcList.ItemIndex := ProcList.Items.IndexOf(OldProc);
- EnableButs;
- end;
- end.