@node-ctypes/winrt - v0.1.0
    Preparing search index...

    Class WinRTObject

    Base wrapper for projected WinRT objects (runtimeclass and interface instances).

    Implements Disposable (using obj = ...): calls IClosable::Close() if supported, then releases the underlying COM reference.

    Implements

    • Disposable
    Index
    raw: COMPointer
    • Adopt a raw native interface pointer address (takes ownership of 1 reference).

      Type Parameters

      Parameters

      • this: new (pointer: COMPointer) => T
      • address: bigint
      • iface: InterfaceDef<any> = IInspectable
      • addRef: boolean = false

      Returns T

    • Query another WinRT/COM interface (QueryInterface), returning a new owned COM pointer.

      Type Parameters

      • I extends InterfaceDef<any, any>

      Parameters

      • iface: I

      Returns InterfacePointer<I>

    • Try QueryInterface, returning null if the interface is not supported.

      Type Parameters

      • I extends InterfaceDef<any, any>

      Parameters

      • iface: I

      Returns InterfacePointer<I> | null

    • Cast (QueryInterface) this WinRT object to a projected runtime class (e.g. const btn = root.findName("MyBtn")!.as(Button)), returning a new owned wrapper.

      Type Parameters

      Parameters

      • TargetClass: new (pointer: COMPointer) => T & { defaultInterface: InterfaceDef<any> }

      Returns T

    • Like as, returning null if the object does not implement TargetClass.

      Type Parameters

      Parameters

      • TargetClass: new (pointer: COMPointer) => T & { defaultInterface: InterfaceDef<any> }

      Returns T | null

    • Return the concrete WinRT runtime class name (IInspectable::GetRuntimeClassName).

      Returns string

    • Close (IClosable::Close when supported), release the COM reference, and dispose any attached COM aggregate when no external COM refs remain.

      Returns void