Ver Mensaje Individual
  #6  
Antiguo 06-09-2010
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.197
Reputación: 20
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Prueba asi:

Código Delphi [-]
var
   ts : TStrings;
   h : word; //creo
   i: integer;
begin
   ts := TStringList.Create;
   try
      ts.LoadFromFile('prueba.txt');
      for i:=0 to ts.Count -1 do
      begin
         h := FindWindow(nil, PCHAR(ts[i]));
         if h <> 0 then PostMessage(h, WM_CLOSE, 0, 0);
      end;
   finally
      ts.Free;
   end;
end;
o así:

Código Delphi [-]
var
   f : TextFile;
   s : string;
   h : word; //creo
begin
   AssignFile (f,'prueba.txt');
   try
      Reset(f);
      while (not Eof(f)) do // Mientras no llegue al final
      begin
         ReadLn(f,s);
         h := FindWindow(nil, PCHAR(s));
         if h <> 0 then PostMessage(h, WM_CLOSE, 0, 0);
      end;
   finally
      CloseFile(f);
   end;
end;

Saludos.
Responder Con Cita