Get guid from progid, ...
(cls, progid: Any)
| 52 | |
| 53 | @classmethod |
| 54 | def from_progid(cls, progid: Any) -> "hints.Self": |
| 55 | """Get guid from progid, ...""" |
| 56 | if hasattr(progid, "_reg_clsid_"): |
| 57 | progid = progid._reg_clsid_ |
| 58 | if isinstance(progid, cls): |
| 59 | return progid |
| 60 | elif isinstance(progid, str): |
| 61 | if progid.startswith("{"): |
| 62 | return cls(progid) |
| 63 | inst = cls() |
| 64 | _CLSIDFromProgID(str(progid), byref(inst)) |
| 65 | return inst |
| 66 | else: |
| 67 | raise TypeError(f"Cannot construct guid from {progid!r}") |
| 68 | |
| 69 | def as_progid(self) -> str: |
| 70 | """Convert a GUID into a progid""" |
no outgoing calls