In Delphi, the LibModuleList is a global variable that contains a list of all of the dynamic-link libraries (DLLs) that are currently loaded in the process. It is a field of the System unit, which is automatically included in every Delphi program.
To use LibModuleList, you can simply reference it in your code like this:
1 2 3 4 5 6 7 8 |
uses System; //Iterate through the list of loaded DLLs for i := 0 to LibModuleList.Count – 1 do begin //Print the name of the DLL WriteLn(LibModuleList[i].Name); end; |
You can also use the LibModuleList to access the Module record for a particular DLL by using the FindModule function:
1 2 3 4 5 6 7 8 |
uses System; //Find the module record for a DLL with a particular name module = LibModuleList.FindModule(‘mydll.dll’); if module = nil then begin // Do something with the module record end; |
Note that the Module record contains information about the DLL, such as its name, handle, and the address of its entry point. You can use this information to perform operations on the DLL, such as calling functions exported from the DLL or unloading the DLL from the process.
For more information about LibModuleList and the Module record, you can consult the Delphi documentation or search online for examples and tutorials.
Leave a Reply