win32com.client.Dispatch Class Label

杀马特。学长 韩版系。学妹 提交于 2019-12-02 06:46:17

I do not think it is possible to get the list of COM objects directly from python, however you can run the following code (and indeed run it from inside python) in Powershell:

Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object {
   $_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID")
} | Select-Object -ExpandProperty PSChildName

This will output a list of all valid names of COM objects on your system sorted alphabetically, and the syntax is normally MainProgram.SubFunction.

Some of the output on my machine:

I hope this helps!

This "Celestron.Telescope" string is called a ProgID (you can google on this term quite easily).

They arere located under the HKEY_LOCAL_MACHINE\SOFTWARE\Classes registry key for the whole machine and in HKEY_CLASSES_ROOT for the current running user.

When COM creates an instance of a component, it will use the current user's view of the registry. Most keys are in HKLM but there can be some local overrides in HKCR.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!