function GetModuleFileNameStr(Instance: THandle): String;
var
 buffer : array [0..MAX_PATH] of Char;
begin
 GetModuleFileName( Instance, buffer, MAX_PATH);
 Result := buffer;
end;

 GetModuleFileNameStr(Hinstance); // dll name
 GetModuleFileNameStr(0); // exe name


2010-10-27 • Просмотров [ 1375 ]