* Added GetModuleName

git-svn-id: trunk@9596 -
This commit is contained in:
michael 2007-12-30 21:50:40 +00:00
parent eec321b2f8
commit d7f94a8282
2 changed files with 14 additions and 1 deletions

View File

@ -237,7 +237,9 @@ Type
function SafeLoadLibrary(const FileName: AnsiString;
ErrorMode: DWord = {$ifdef windows}SEM_NOOPENFILEERRORBOX{$else windows}0{$endif windows}): HMODULE;
function GetModuleName(Module: HMODULE): string;
{ some packages and unit related constants for compatibility }
const

View File

@ -625,3 +625,14 @@ function SafeLoadLibrary(const FileName: AnsiString;
{$endif}
end;
end;
function GetModuleName(Module: HMODULE): string;
begin
{$ifdef MSWINDOWS}
SetLength(Result,MAX_PATH);
SetLength(Result,GetModuleFileName(Module, Pchar(Result),Length(Result)));
{$ELSE}
Result:='';
{$ENDIF}
end;