Can a Windows dll retrieve its own filename? | A Windows process created from an exe file has access to the command string which invoked it, including its file's path and filename. eg. `C:\MyApp\MyApp.exe --help`.


But this is not so for a dll invoked via `LoadLibrary`. Does anyone know of a way for a function loaded via dll to find out what its path and filename is?


Specifically I'm interested in a Delphi solution, but I suspect that the answer would be pretty much the same for any language.