//我用win系统变量解决
program Project1;uses
  Forms,
  Windows,
  Dialogs,
  Unit1 in 'Unit1.pas' {Form1};{$R *.res}var
  vATOM: ATOM;const
  ATOMID = 'Zswang方法';begin
  if GlobalFindAtom(ATOMID) > 0 then begin
    ShowMessage(ATOMID);
    Exit;
  end;  vATOM := GlobalAddAtom(ATOMID);
  try
    Application.Initialize;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
  finally
    GlobalDeleteAtom(vATOM);
  end;
end.

解决方案 »

  1.   

    var
      ATOMID: string;begin
      ATOMID := Application.ExeName;
    //.........
    //.........
    end;
      

  2.   

    有一种方法,Takes a snapshot of the processes and the heaps, modules, and threads used by the processes.HANDLE WINAPI CreateToolhelp32Snapshot(
      DWORD dwFlags,       
      DWORD th32ProcessID  
    );
      

  3.   

    win全局变量其他程序也可访问呀
      

  4.   

    老兄:
       你看看msdn吧!通过这种东西,可以找到所有的进程,线程。可以找到,windows任务管理器中的所有进程