>mmmmmm yep it works but it seems very longwinded to get a simple piece of information. There must be an API call that you can pass the name of an OCX to and it will return whether it is registered or not.
No, because you don't refer to the OCX, you refer to the name of the class (ProgID) registered in HKEY_CLASSES_ROOT or the unique identifier (CLSID) in HKEY_CLASSES_ROOT. The only place you will find the file name at all is in the InProcServer32 registry subkey of the CLSID in the case of an OCX. The file name has nothing (zero, nil, nada, nunca) to do with the classes it contains; a single file can contain several classes, and more importantly, a given file name can have different contents. You have to find things by their registry name, not the name of the file.