Perdona, el corrector ortografico hizo de las suyas en mi mensaje.
Cambio PamaStr(0) por Parametro 0
El codigo quedaria asi:
Código Delphi
[-]
uses PsApi;
function CuantosSomos: Integer;
var
Procesos: array[1..1024] of DWORD;
Needed, i: DWORD;
Process: THandle;
ModName: array[0..MAX_PATH] of Char;
begin
Result:= 0;
if EnumProcesses(@Procesos,SizeOf(Procesos),Needed) then
begin
for i:= 1 to (Needed div Sizeof(DWORD)) do
begin
Process := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ,
FALSE,Procesos[i]);
if Process <> 0 then
begin
if GetModuleBaseName(Process,0,ModName,SizeOf(ModName)-1)>0 then
begin
if StrIComp(ModName,PChar('winword.exe')) = 0 then
inc(Result);
end;
CloseHandle(Process);
end;
end;
end;
end;
ShowMessage(IntToStr(CuantosSomos));