2
0
Эх сурвалжийг харах

* Added GetModuleName

git-svn-id: trunk@9596 -
michael 17 жил өмнө
parent
commit
d7f94a8282

+ 3 - 1
rtl/objpas/sysutils/sysutilh.inc

@@ -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

+ 11 - 0
rtl/objpas/sysutils/sysutils.inc

@@ -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;