TLHelp32,Buttons, ComCtrls, ExtCtrls,ShellAPI, MyFlag;
const
PROCESS_TERMINATE=0;
SYSTRAY_ID=1;
WM_SYSTRAYMSG=WM_USER+100;
type
TForm1 = class(TForm)
lvSysProc: TListView;
lblSysProc: TLabel;
lblAboutProc: TLabel;
lvAboutProc: TListView;
lblCountSysProc: TLabel;
lblCountAboutProc: TLabel;
Panel1: TPanel;
btnDetermine: TButton;
btnRefresh: TButton;
lblOthers: TLabel;
lblEmail: TLabel;
MyFlag1: TMyFlag;
procedure btnRefreshClick(Sender: TObject);
procedure btnDetermineClick(Sender: TObject);
procedure lvSysProcClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure AppOnMinimize(Sender:TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDeactivate(Sender: TObject);
procedure lblEmailClick(Sender: TObject);
procedure FormResize(Sender: TObject);
private
{ Private declarations }
fshandle:thandle;
FormOldHeight,FormOldWidth:Integer;
procedure SysTrayOnClick(var message:TMessage);message WM_SYSTRAYMSG;
public
{ Public declarations }
end;
var
Form1: TForm1;
idid: dword;
fp32:tprocessentry32;
fm32:tmoduleentry32;
SysTrayIcon:TNotifyIconData;
implementation
{$R *.DFM}
function RegisterServiceProcess(dwProcessID,dwType:integer):integer;stdcall;external ''KERNEL32.DLL'';
procedure TForm1.btnRefreshClick(Sender: TObject);
var
clp:bool;
newitem1:Tlistitem;
MyIcon:TIcon;
IconIndex:word;
ProcFile : array[0..MAX_PATH] of char;
begin
MyIcon:=TIcon.create;
lvSysProc.Items.clear;
lvSysProc.SmallImages.clear;
fshandle:=CreateToolhelp32Snapshot(th32cs_snapprocess,0);
fp32.dwsize:=sizeof(fp32);
clp:=process32first(fshandle,fp32);
IconIndex:=0;
while integer(clp)<>0 do
begin
if fp32.th32processid<>getcurrentprocessid then
begin
newitem1:=lvSysProc.items.add;
{
newitem1.caption:=fp32.szexefile;
MyIcon.Handle:=ExtractIcon(Form1.Handle,fp32.szexefile,0);
}
&nb