winrt.runtime module

Activation

Functions related to preparing the WinRT runtime for use.

init_apartment(apartment_type: ApartmentType) None

Initializes the WinRT runtime in the specified apartment type.

Calling this function is only necessary if you need a single threaded, e.g. for UI thread, or if you need to re-initalize the thread with a different apartment type.

Parameters:

apartment_type (ApartmentType) – The apartment type to initialize the runtime in.

Added in version 3.0.

uninit_apartment() None

Uninitializes the WinRT runtime.

Not necessary on thread exit, but can be used uninitalize and re-initalize a thread if needed.

Added in version 3.0.

class ApartmentType

Enumeration of COM apartment types.

SINGLE_THREADED

Single-threaded apartment.

MULTI_THREADED

Multi-threaded apartment.

Added in version 3.0.