tessl install tessl/pypi-comtypes@1.4.0Pure Python COM package for Windows COM automation and interoperability
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.99x
Baseline
Agent success rate without this tile
89%
Build a Python utility that automates interactions with Windows shell components by creating and controlling COM objects. The utility focuses on creating COM objects and accessing their properties.
Implement a module that provides the following functionality:
The module should handle errors gracefully when COM objects cannot be created or accessed.
@generates
def create_shell_object():
"""
Create and return a new Windows Shell Application COM object.
Returns:
COM object representing Shell.Application
Raises:
RuntimeError: If the COM object cannot be created
"""
pass
def get_active_shell_object():
"""
Connect to an already-running Windows Shell Application COM object.
Returns:
COM object representing active Shell.Application, or None if not found
"""
pass
def browse_folder(shell_obj, folder_id):
"""
Browse to a special shell folder using the shell object.
Args:
shell_obj: Shell.Application COM object
folder_id: Integer identifying the special folder (e.g., 0 for Desktop)
Returns:
Folder COM object representing the browsed folder
Raises:
RuntimeError: If folder cannot be accessed
"""
pass
def get_folder_title(folder_obj):
"""
Get the title of a shell folder object.
Args:
folder_obj: Folder COM object
Returns:
String containing the folder title
"""
passProvides COM interoperability for Windows automation.