[python-win32] Setting Focus Assist Mode via COM

Steven Manross steven at manross.net
Tue May 30 17:41:21 EDT 2023


While I haven’t worked on exactly what you are working on:

I’d first verify suggest that the application that installs this class needs to be installed on the PC you are trying to create the automation from, because “Class not Registered” isn’t a python error, and it talks more directly to the fact that the appropriate class from the software you are trying to automate isn’t on the computer you are running python from: so either you have the wrong CLSID or are doing something else wrong (missing software???).

Classes are listed in the registry here:

HKEY_CLASSES_ROOT\clsid\{6bff4732-81ec-4ffb-ae67-b6c1bc29631f}

… and your CLSID would need to exist (as installed from whatever software you are trying to automate) prior to python being able to automate it.

Here is an example that should work on your system…

ms_dict = win32com.client.Dispatch('Scripting.Dictionary')

… because the scripting dictionary object class is installed in just about every Windows OS since pre-WindowsXP

I hope this helps.  Enjoy your day.

Steven
From: python-win32 <python-win32-bounces+steven=manross.net at python.org> On Behalf Of name zero via python-win32
Sent: Monday, May 29, 2023 6:02 AM
To: python-win32 at python.org
Subject: [python-win32] Setting Focus Assist Mode via COM

Hi,

could someone help me out with first steps for how to set Focus Assist via COM, which https://gist.github.com/riverar/085d98ffb1343e92225a10817109b2e3 demonstrates for a C++ code base? Something like

win32com.client.Dispatch('{6bff4732-81ec-4ffb-ae67-b6c1bc29631f}', clsctx=pythoncom.CLSCTX_LOCAL_SERVER)

fails with "pywintypes.com_error: (-2147221164, 'Class not registered', None, None)"

Thank you and best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20230530/052e33e2/attachment-0001.html>


More information about the python-win32 mailing list