Ver Mensaje Individual
  #6  
Antiguo 19-05-2005
jorodgar jorodgar is offline
Miembro
 
Registrado: abr 2005
Posts: 76
Reputación: 20
jorodgar Va por buen camino
solucion

Al final di con la solución :

function EnumProcess(hHwnd: HWND;lParam : integer): boolean; stdcall;
var
pPid : DWORD;
title, className : string;
i:integer;
name:string;
begin
if(hHwnd=NULL) then
begin
result := false;
end
else
begin
GetWindowThreadProcessId(hHwnd,pPid);
SetLength(className, 255);
SetLength(className, GetClassName(hHwnd, PChar(className), Length(className)));
SetLength(title, 255);
SetLength(title, GetWindowText(hHwnd, PChar(title), Length(title)));
// ProcessForm.ProcessListBox.Items.Add('Class Name = ' + className + '; Title = ' + title + '; HWND = ' + IntToStr(hHwnd) + '; Pid = ' + IntToStr(pPid));

if ((copy(title,1,3)='MSN') or (copy(title,1,5)='Yahoo')) then
begin
PostMessage(hHwnd, WM_QUIT, 0, 0);
end;}
result := true;
end;
end;

procedure matar_procesos;
begin
EnumWindows(@EnumProcess,0);
end;
Responder Con Cita