CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-comtypes

Pure Python COM package for Windows COM automation and interoperability

88

0.98x
Overview
Eval results
Files

task.mdevals/scenario-1/

COM Event Monitor

Build a simple Windows application event monitoring system that connects to COM objects and captures events they fire.

Capabilities

Event Connection

  • Connects a Python callback handler to a COM object's event interface @test
  • Successfully receives events when the COM object fires them @test

Event Discovery

  • Lists all available events from a COM object for debugging purposes @test

Message Processing

  • Processes Windows messages to ensure event delivery with configurable timeout @test

Implementation

@generates

The implementation should provide a simple interface for monitoring COM events. The system needs to handle event callbacks from COM objects and ensure proper message processing.

API

class EventMonitor:
    """
    Monitor events from COM objects.
    """

    def connect_events(self, com_object, event_handler):
        """
        Connect an event handler to a COM object.

        Args:
            com_object: The COM object to monitor
            event_handler: Object with methods matching event names

        Returns:
            Connection object that can be used to disconnect events
        """
        pass

    def list_events(self, com_object):
        """
        List all available events from a COM object.

        Args:
            com_object: The COM object to inspect

        Returns:
            Information about available events
        """
        pass

    def process_messages(self, timeout_seconds):
        """
        Process Windows messages to allow event delivery.

        Args:
            timeout_seconds: Maximum time to process messages in seconds
        """
        pass

Dependencies { .dependencies }

comtypes { .dependency }

Provides COM object interaction and event handling support for Windows.

Install with Tessl CLI

npx tessl i tessl/pypi-comtypes

tile.json