How to use the comtypes.COMMETHOD function in comtypes

To help you get started, we’ve selected a few comtypes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AndreMiras / pycaw / pycaw / pycaw.py View on Github external
COMMETHOD([], HRESULT, 'NotImpl2'),
        # HRESULT GetIconPath([out] LPWSTR *pRetVal);
        COMMETHOD([], HRESULT, 'NotImpl3'),
        # HRESULT SetIconPath(
        # [in] LPCWSTR Value,
        # [in] LPCGUID EventContext);
        COMMETHOD([], HRESULT, 'NotImpl4'),
        # HRESULT GetGroupingParam([out] GUID *pRetVal);
        COMMETHOD([], HRESULT, 'NotImpl5'),
        # HRESULT SetGroupingParam(
        # [in] LPCGUID Grouping,
        # [in] LPCGUID EventContext);
        COMMETHOD([], HRESULT, 'NotImpl6'),
        # HRESULT RegisterAudioSessionNotification(
        # [in] IAudioSessionEvents *NewNotifications);
        COMMETHOD([], HRESULT, 'NotImpl7'),
        # HRESULT UnregisterAudioSessionNotification(
        # [in] IAudioSessionEvents *NewNotifications);
        COMMETHOD([], HRESULT, 'NotImpl8'))


class IAudioSessionControl2(IAudioSessionControl):
    _iid_ = GUID('{BFB7FF88-7239-4FC9-8FA2-07C950BE9C6D}')
    _methods_ = (
        # HRESULT GetSessionIdentifier([out] LPWSTR *pRetVal);
        COMMETHOD([], HRESULT, 'GetSessionIdentifier',
                  (['out'], POINTER(LPWSTR), 'pRetVal')),
        # HRESULT GetSessionInstanceIdentifier([out] LPWSTR *pRetVal);
        COMMETHOD([], HRESULT, 'GetSessionInstanceIdentifier',
                  (['out'], POINTER(LPWSTR), 'pRetVal')),
        # HRESULT GetProcessId([out] DWORD *pRetVal);
        COMMETHOD([], HRESULT, 'GetProcessId',
github Qirky / PyKinectTk / PyKinectTk / utils / PyKinect2 / PyKinectV2.py View on Github external
##        #return waitableHandle
##
##    @property
##    def IsActive(self):
##        '-no docstring-'
##        #return IsActive
##

class IInfraredFrameReference(comtypes.IUnknown):
    _case_insensitive_ = True
    _iid_ = GUID('{60183D5B-DED5-4D5C-AE59-64C7724FE5FE}')
    _idlflags_ = []
IMultiSourceFrame._methods_ = [
    COMMETHOD(['propget'], HRESULT, 'colorFrameReference',
              ( ['retval', 'out'], POINTER(POINTER(IColorFrameReference)), 'colorFrameReference' )),
    COMMETHOD(['propget'], HRESULT, 'depthFrameReference',
              ( ['retval', 'out'], POINTER(POINTER(IDepthFrameReference)), 'depthFrameReference' )),
    COMMETHOD(['propget'], HRESULT, 'bodyFrameReference',
              ( ['retval', 'out'], POINTER(POINTER(IBodyFrameReference)), 'bodyFrameReference' )),
    COMMETHOD(['propget'], HRESULT, 'bodyIndexFrameReference',
              ( ['retval', 'out'], POINTER(POINTER(IBodyIndexFrameReference)), 'bodyIndexFrameReference' )),
    COMMETHOD(['propget'], HRESULT, 'infraredFrameReference',
              ( ['retval', 'out'], POINTER(POINTER(IInfraredFrameReference)), 'infraredFrameReference' )),
    COMMETHOD(['propget'], HRESULT, 'longExposureInfraredFrameReference',
              ( ['retval', 'out'], POINTER(POINTER(ILongExposureInfraredFrameReference)), 'longExposureInfraredFrameReference' )),
]
################################################################
## code template for IMultiSourceFrame implementation
##class IMultiSourceFrame_Impl(object):
##    @property
##    def depthFrameReference(self):
##        '-no docstring-'
github Qirky / PyKinectTk / PyKinectTk / utils / PyKinect2 / PyKinectV2.py View on Github external
assert sizeof(_CameraIntrinsics) == 28, sizeof(_CameraIntrinsics)
assert alignment(_CameraIntrinsics) == 4, alignment(_CameraIntrinsics)
class ICoordinateMapper(comtypes.IUnknown):
    _case_insensitive_ = True
    _iid_ = GUID('{8784DF2D-16B0-481C-A11E-55E70BF25018}')
    _idlflags_ = []
class ICoordinateMappingChangedEventArgs(comtypes.IUnknown):
    _case_insensitive_ = True
    _iid_ = GUID('{E9A2A0BF-13BD-4A53-A157-91FC8BB41F85}')
    _idlflags_ = []
ICoordinateMapper._methods_ = [
    COMMETHOD([], HRESULT, 'SubscribeCoordinateMappingChanged',
              ( ['retval', 'out'], POINTER(INT_PTR), 'waitableHandle' )),
    COMMETHOD([], HRESULT, 'UnsubscribeCoordinateMappingChanged',
              ( ['in'], INT_PTR, 'waitableHandle' )),
    COMMETHOD([], HRESULT, 'GetCoordinateMappingChangedEventData',
              ( ['in'], INT_PTR, 'waitableHandle' ),
              ( ['retval', 'out'], POINTER(POINTER(ICoordinateMappingChangedEventArgs)), 'eventData' )),
    COMMETHOD([], HRESULT, 'MapCameraPointToDepthSpace',
              ( [], _CameraSpacePoint, 'cameraPoint' ),
              ( ['retval', 'out'], POINTER(_DepthSpacePoint), 'depthPoint' )),
    COMMETHOD([], HRESULT, 'MapCameraPointToColorSpace',
              ( [], _CameraSpacePoint, 'cameraPoint' ),
              ( ['retval', 'out'], POINTER(_ColorSpacePoint), 'colorPoint' )),
    COMMETHOD([], HRESULT, 'MapDepthPointToCameraSpace',
              ( [], _DepthSpacePoint, 'depthPoint' ),
              ( [], c_ushort, 'depth' ),
              ( ['retval', 'out'], POINTER(_CameraSpacePoint), 'cameraPoint' )),
    COMMETHOD([], HRESULT, 'MapDepthPointToColorSpace',
              ( [], _DepthSpacePoint, 'depthPoint' ),
              ( [], c_ushort, 'depth' ),
              ( ['retval', 'out'], POINTER(_ColorSpacePoint), 'colorPoint' )),
github Kinect / PyKinect2 / pykinect2 / PyKinectV2.py View on Github external
# values for enumeration '_Expression'
Expression_Neutral = 0
Expression_Happy = 1
Expression_Count = 2
_Expression = c_int # enum
IColorFrame._methods_ = [
    COMMETHOD(['propget'], HRESULT, 'RawColorImageFormat',
              ( ['retval', 'out'], POINTER(_ColorImageFormat), 'RawColorImageFormat' )),
    COMMETHOD(['propget'], HRESULT, 'FrameDescription',
              ( ['retval', 'out'], POINTER(POINTER(IFrameDescription)), 'rawFrameDescription' )),
    COMMETHOD([], HRESULT, 'CopyRawFrameDataToArray',
              ( [], c_uint, 'capacity' ),
              ( [], POINTER(c_ubyte), 'frameData' )),
    COMMETHOD([], HRESULT, 'AccessRawUnderlyingBuffer',
              ( [], POINTER(c_uint), 'capacity' ),
              ( [], POINTER(POINTER(c_ubyte)), 'buffer' )), #'out'
    COMMETHOD([], HRESULT, 'CopyConvertedFrameDataToArray',
              ( [], c_uint, 'capacity' ),
              ( [], POINTER(c_ubyte), 'frameData' ), #( [], POINTER(c_ubyte), 'frameData' )
              ( [], _ColorImageFormat, 'colorFormat' )),
    COMMETHOD([], HRESULT, 'CreateFrameDescription',
              ( [], _ColorImageFormat, 'format' ),
              ( ['retval', 'out'], POINTER(POINTER(IFrameDescription)), 'FrameDescription' )),
    COMMETHOD(['propget'], HRESULT, 'ColorCameraSettings',
              ( ['retval', 'out'], POINTER(POINTER(IColorCameraSettings)), 'ColorCameraSettings' )),
    COMMETHOD(['propget'], HRESULT, 'RelativeTime',
              ( ['retval', 'out'], POINTER(c_longlong), 'RelativeTime' )),
    COMMETHOD(['propget'], HRESULT, 'ColorFrameSource',
              ( ['retval', 'out'], POINTER(POINTER(IColorFrameSource)), 'ColorFrameSource' )),
]
github cloudbase / cloudbase-init / cloudbaseinit / utils / windows / vds.py View on Github external
comtypes.COMMETHOD([], comtypes.HRESULT, 'GetIdentificationData',
                           (['out'], ctypes.c_void_p, 'pLunInfo')),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'QueryExtents',
                           (['out'], ctypes.POINTER(ctypes.POINTER(
                                                    VDS_DISK_EXTENT)),
                            'ppExtentArray'),
                           (['out'], ctypes.POINTER(wintypes.LONG),
                            'plNumberOfExtents')),
    ]


class IVdsAsync(comtypes.IUnknown):
    _iid_ = comtypes.GUID("{d5d23b6d-5a55-4492-9889-397a3c2d2dbc}")

    _methods_ = [
        comtypes.COMMETHOD([], comtypes.HRESULT, 'Cancel'),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'Wait',
                           (['out'], ctypes.POINTER(
                               ctypes.HRESULT), 'pHrResult'),
                           (['out'], ctypes.POINTER(VDS_ASYNC_OUTPUT),
                            'pAsyncOut')),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'QueryStatus',
                           (['out'], ctypes.POINTER(
                            ctypes.HRESULT), 'pHrResult'),
                           (['out'], ctypes.POINTER(wintypes.ULONG),
                            'pulPercentCompleted')),
    ]


class IVdsVolume(comtypes.IUnknown):
    _iid_ = comtypes.GUID("{88306bb2-e71f-478c-86a2-79da200a0f11}")
github ipaleka / arrangeit / arrangeit / windows / vdi.py View on Github external
),
        COMMETHOD(
            [helpstring("Method GetViewForHwnd")],
            ctypes.HRESULT,
            "GetViewForHwnd",
            (["in"], ctypes.wintypes.HWND, "hwnd"),
            (["out"], ctypes.POINTER(ctypes.POINTER(IApplicationView)), "view"),
        ),
        COMMETHOD(
            [helpstring("Method GetViewForApplication")],
            ctypes.HRESULT,
            "GetViewForApplication",
            (["in"], ctypes.POINTER(ctypes.wintypes.UINT), "application"),
            (["out"], ctypes.POINTER(ctypes.POINTER(IApplicationView)), "view"),
        ),
        COMMETHOD(
            [helpstring("Method GetViewForAppUserModelId")],
            ctypes.HRESULT,
            "GetViewForAppUserModelId",
            (["in"], ctypes.wintypes.LPCWSTR, "id"),
            (["out"], ctypes.POINTER(ctypes.POINTER(IApplicationView)), "view"),
        ),
        COMMETHOD(
            [helpstring("Method GetViewInFocus")],
            ctypes.HRESULT,
            "GetViewInFocus",
            (["out"], ctypes.POINTER(ctypes.POINTER(IApplicationView)), "view"),
        ),
        COMMETHOD(
            [helpstring("Method Unknown1")],
            ctypes.HRESULT,
            "Unknown1",
github r0x0r / pywebview / webview / win32_gen.py View on Github external
( ["in"], POINTER(tagRECT), "prcBorder" ),
              ( ["in"], POINTER(IOleInPlaceUIWindow), "pUIWindow" ),
              ( ["in"], c_int, "fRameWindow" )),
    COMMETHOD([], HRESULT, "TranslateAccelerator",
              ( ["in"], POINTER(tagMSG), "lpmsg" ),
              ( ["in"], POINTER(GUID), "pguidCmdGroup" ),
              ( ["in"], c_ulong, "nCmdID" )),
    COMMETHOD([], HRESULT, "GetOptionKeyPath",
              ( ["out"], POINTER(c_wchar_p), "pchKey" ),
              ( ["in"], c_ulong, "dw" )),
    COMMETHOD([], HRESULT, "GetDropTarget",
              ( ["in"], POINTER(IDropTarget), "pDropTarget" ),
              ( ["out"], POINTER(POINTER(IDropTarget)), "ppDropTarget" )),
    COMMETHOD([], HRESULT, "GetExternal",
              ( ["out"], POINTER(POINTER(IDispatch)), "ppDispatch" )),
    COMMETHOD([], HRESULT, "TranslateUrl",
              ( ["in"], c_ulong, "dwTranslate" ),
              ( ["in"], POINTER(c_ushort), "pchURLIn" ),
              ( ["out"], POINTER(POINTER(c_ushort)), "ppchURLOut" )),
    COMMETHOD([], HRESULT, "FilterDataObject",
              ( ["in"], POINTER(IDataObject), "pDO" ),
              ( ["out"], POINTER(POINTER(IDataObject)), "ppDORet" )),
]

class MINMAXINFO(Structure):
    _fields_ = [
        ("ptReserved", POINT),
        ("ptMaxSize", POINT),
        ("ptMaxPosition", POINT),
        ("ptMinTrackSize", POINT),
        ("ptMaxTrackSize", POINT)
    ]
github Qirky / PyKinectTk / PyKinectTk / utils / PyKinect2 / PyKinectV2.py View on Github external
COMMETHOD([], HRESULT, 'GetExpressionDetectionResults',
              ( [], c_uint, 'capacity' ),
              ( [], POINTER(_DetectionResult), 'detectionResults' )),
    COMMETHOD([], HRESULT, 'GetActivityDetectionResults',
              ( [], c_uint, 'capacity' ),
              ( [], POINTER(_DetectionResult), 'detectionResults' )),
    COMMETHOD([], HRESULT, 'GetAppearanceDetectionResults',
              ( [], c_uint, 'capacity' ),
              ( [], POINTER(_DetectionResult), 'detectionResults' )),
    COMMETHOD(['propget'], HRESULT, 'HandLeftState',
              ( ['retval', 'out'], POINTER(_HandState), 'handState' )),
    COMMETHOD(['propget'], HRESULT, 'HandLeftConfidence',
              ( ['retval', 'out'], POINTER(_TrackingConfidence), 'confidence' )),
    COMMETHOD(['propget'], HRESULT, 'HandRightState',
              ( ['retval', 'out'], POINTER(_HandState), 'handState' )),
    COMMETHOD(['propget'], HRESULT, 'HandRightConfidence',
              ( ['retval', 'out'], POINTER(_TrackingConfidence), 'confidence' )),
    COMMETHOD(['propget'], HRESULT, 'ClippedEdges',
              ( ['retval', 'out'], POINTER(c_ulong), 'ClippedEdges' )),
    COMMETHOD(['propget'], HRESULT, 'TrackingId',
              ( ['retval', 'out'], POINTER(c_ulonglong), 'TrackingId' )),
    COMMETHOD(['propget'], HRESULT, 'IsTracked',
              ( ['retval', 'out'], POINTER(c_bool), 'tracked' )),
    COMMETHOD(['propget'], HRESULT, 'IsRestricted',
              ( ['retval', 'out'], POINTER(c_bool), 'IsRestricted' )),
    COMMETHOD(['propget'], HRESULT, 'Lean',
              ( ['retval', 'out'], POINTER(_PointF), 'amount' )),
    COMMETHOD(['propget'], HRESULT, 'LeanTrackingState',
              ( ['retval', 'out'], POINTER(_TrackingState), 'TrackingState' )),
]
################################################################
## code template for IBody implementation
github AndreMiras / pycaw / pycaw / pycaw.py View on Github external
class IAudioSessionControl(IUnknown):
    _iid_ = GUID('{F4B1A599-7266-4319-A8CA-E70ACB11E8CD}')
    _methods_ = (
        # HRESULT GetState ([out] AudioSessionState *pRetVal);
        COMMETHOD([], HRESULT, 'NotImpl1'),
        # HRESULT GetDisplayName([out] LPWSTR *pRetVal);
        COMMETHOD([], HRESULT, 'GetDisplayName',
                  (['out'], POINTER(LPWSTR), 'pRetVal')),
        # HRESULT SetDisplayName(
        # [in] LPCWSTR Value,
        # [in] LPCGUID EventContext);
        COMMETHOD([], HRESULT, 'NotImpl2'),
        # HRESULT GetIconPath([out] LPWSTR *pRetVal);
        COMMETHOD([], HRESULT, 'NotImpl3'),
        # HRESULT SetIconPath(
        # [in] LPCWSTR Value,
        # [in] LPCGUID EventContext);
        COMMETHOD([], HRESULT, 'NotImpl4'),
        # HRESULT GetGroupingParam([out] GUID *pRetVal);
        COMMETHOD([], HRESULT, 'NotImpl5'),
        # HRESULT SetGroupingParam(
        # [in] LPCGUID Grouping,
        # [in] LPCGUID EventContext);
        COMMETHOD([], HRESULT, 'NotImpl6'),
        # HRESULT RegisterAudioSessionNotification(
        # [in] IAudioSessionEvents *NewNotifications);
        COMMETHOD([], HRESULT, 'NotImpl7'),
        # HRESULT UnregisterAudioSessionNotification(
        # [in] IAudioSessionEvents *NewNotifications);
        COMMETHOD([], HRESULT, 'NotImpl8'))
github cloudbase / cloudbase-init / cloudbaseinit / utils / windows / vds.py View on Github external
]


class IVdsDisk(comtypes.IUnknown):
    _iid_ = comtypes.GUID("{07e5c822-f00c-47a1-8fce-b244da56fd06}")

    _methods_ = [
        comtypes.COMMETHOD([], comtypes.HRESULT, 'GetProperties',
                           (['out'], ctypes.POINTER(VDS_DISK_PROP),
                            'pDiskProperties')),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'GetPack',
                           (['out'], ctypes.POINTER(ctypes.POINTER(IVdsPack)),
                            'ppPack')),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'GetIdentificationData',
                           (['out'], ctypes.c_void_p, 'pLunInfo')),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'QueryExtents',
                           (['out'], ctypes.POINTER(ctypes.POINTER(
                                                    VDS_DISK_EXTENT)),
                            'ppExtentArray'),
                           (['out'], ctypes.POINTER(wintypes.LONG),
                            'plNumberOfExtents')),
    ]


class IVdsAsync(comtypes.IUnknown):
    _iid_ = comtypes.GUID("{d5d23b6d-5a55-4492-9889-397a3c2d2dbc}")

    _methods_ = [
        comtypes.COMMETHOD([], comtypes.HRESULT, 'Cancel'),
        comtypes.COMMETHOD([], comtypes.HRESULT, 'Wait',
                           (['out'], ctypes.POINTER(
                               ctypes.HRESULT), 'pHrResult'),