mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 08:59:05 +02:00
* Added GetModuleName
git-svn-id: trunk@9596 -
This commit is contained in:
parent
eec321b2f8
commit
d7f94a8282
@ -237,7 +237,9 @@ Type
|
|||||||
|
|
||||||
function SafeLoadLibrary(const FileName: AnsiString;
|
function SafeLoadLibrary(const FileName: AnsiString;
|
||||||
ErrorMode: DWord = {$ifdef windows}SEM_NOOPENFILEERRORBOX{$else windows}0{$endif windows}): HMODULE;
|
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 }
|
{ some packages and unit related constants for compatibility }
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -625,3 +625,14 @@ function SafeLoadLibrary(const FileName: AnsiString;
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user