function GetProcessModuleByName(PID: Cardinal; ModuleName: String): Cardinal;
var
Snap: THandle;
M32: TModuleEntry32;
begin
Snap := CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,PID);
if (Snap = 0) then
Exit;
if Module32First(Snap, M32) then begin
repeat
if ModuleName = M32.szModule then begin
Result := Cardinal(M32.modBaseAddr);
Break;
end;
until not Module32Next(Snap, M32);
end;
end;