OK, so my question is, how does a program know if a dependency (such as a DLL) is needed by another app? Like those programs that clean the registry, or an uninstaller, reporting that a file is not used by any other program, and can be removed.

Any ideas how that's done? Poking around in the registry, I see the references to components, but not the apps that use them. Something tells me there is no easy way to make this determination.