しつもーソ!!!
実行しているプロセスのファイル名を取得使用としているのですけれど
他のプロセスのファイル名も自分のファイル名が帰ってきます
なぜなんでしょうか?

フォームにボタンとメモをおいて

function EnumWindowsProc(wnd:THandle; lParam:longint):BOOL; stdcall;
var
 dwProcessId:integer;
 lpString : array [0..255] of Char;
 s : string;
begin
 result := true;
 if (GetWindow(wnd, GW_OWNER) = 0) {and IsWindowVisible(wnd)} then begin
  SendMessage(wnd, WM_GETTEXT, 255, Integer(@lpString));
  s := String(lpString);
  if GetWindowModuleFileName(wnd, lpString, 255) > 0 then begin// FullPathを得る
   s := s + ':' + ExtractFileName(String(lpString));
   Form2.Memo1.Lines.Add(s);
  end;
 end;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
 EnumWindows(@EnumWindowsProc, 0);
end;