{检测delphi是否正在运行}
function delphiisrunning: boolean;
const
a1: array[0..12] of char = ''tapplication''#0;
a2: array[0..15] of char = ''talignpalette''#0;
a3: array[0..18] of char = ''tpropertyinspector''#0;
a4: array[0..11] of char = ''tappbuilder''#0;
{$ifdef win32}
{$ifdef ver130}
t1: array[0..15] of char = ''delphi 5''#0;
{$endif}
{$ifdef ver120}
t1: array[0..15] of char = ''delphi 4''#0;
{$endif}
{$ifdef ver100}
t1: array[0..15] of char = ''delphi 3''#0;
{$endif}
{$ifdef ver90}
t1: array[0..15] of char = ''delphi 2.0''#0;
{$endif}
{$ifdef ver93}
t1: array[0..15] of char = ''c++builder''#0;
{$endif}
{$ifdef ver110}
t1: array[0..15] of char = ''c++builder''#0;
{$endif}
{$ifdef ver125}
t1: array[0..15] of char = ''c++builder 4''#0;
{$endif}
{$else}
t1: array[0..15] of char = ''delphi''#0;
{$endif}
begin
result := (findwindow(a1,t1)<>0) and
(findwindow(a2,nil)<>0) and
(findwindow(a3,nil)<>0) and
(findwindow(a4,nil)<>0);
end;
{检测delphi是否正在运行}