Created
March 16, 2023 21:14
-
-
Save joaompinto/12d8cf53de5c99470d038243c39c29bc to your computer and use it in GitHub Desktop.
List ActiveX Class IDs and names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python re-implemention of the code found at: | |
# | |
# https://github.com/openwebos/qt/blob/master/src/activeqt/container/qaxselect.cpp | |
import winreg | |
clsid_keys = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, "CLSID") | |
i = 0 | |
while True: | |
i = i + 1 | |
try: | |
clsid = winreg.EnumKey(clsid_keys, i) | |
except OSError: # No more data is available | |
break | |
try: | |
subkey = winreg.OpenKey(clsid_keys, f"{clsid}\\Control") | |
except FileNotFoundError: | |
continue | |
ProgId_key = winreg.OpenKey(clsid_keys, f"{clsid}\\ProgId") | |
ControlName = winreg.EnumValue(ProgId_key, 0)[1] | |
print(clsid, ControlName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment