procedure TForm1.Image1DblClick(Sender: TObject);
var
  lppe:TProcessentry32;
  sshandle:THandle;
  Flag,AlreadyExits:Boolean;
begin
  AlreadyExits:=False;
  sshandle:=createtoolhelp32snapshot(TH32CS_SNAPPROCESS,0);
  Flag:=Process32First(sshandle,lppe);
  while Flag do
  begin
    if lowercase(extractfilename(lppe.szExeFile))='excel.exe' then
    begin
      AlreadyExits:=True;
    end;
    Flag:=Process32Next(sshandle,lppe);
  end;  if AlreadyExits = True then
  begin
    Application1.AutoConnect:=True;
    Application1.Visible:=True;
    Form1.AutoSize:=True;
    Form1.Hide;
    CoolTrayIcon1.IconVisible:=True;
    CoolTrayIcon1.MinimizeToTray:=True;
  end
  else
    Showmessage('请先运行Excel!');
end;为何以上代码在Image1中双击图片时能得到正确的结果,但同样的代码在TForm1.FormCreate中却得不到?