How to: Determining programmatically if DLL is registered

Here is a C# code snippet to determine if a particular DLL is registered or not.



public extern static int LoadLibrary(string lpLibFileName);



public extern static bool FreeLibrary(int hLibModule);


public bool IsDllRegistered(string DllName)


      int libId = LoadLibrary(DllName);

      if (libId>0) FreeLibrary(libId);

      return (libId>0);




One thought on “How to: Determining programmatically if DLL is registered”

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>