Click here to Skip to main content
15,880,905 members
Articles / Desktop Programming / Win32

Outlook add-in integrating Skype

Rate me:
Please Sign up or sign in to vote.
4.93/5 (32 votes)
28 May 2015CPOL20 min read 68.7K   2.4K   54  
Outlook add-in integration for Skype IM: Skype events, Outlook Skype ribbon, and more.
static
VOID
btnSkypePresenceOffline_Visible(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    BOOL                *Value
) {
    XAddin* pAddin = (XAddin *)Element->Context;

    *Value = pAddin->SkypeInfo.ApiStatus == SKYPECONTROLAPI_ATTACH_SUCCESS;
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID
btnSkypePresenceOffline_Label(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    LPWSTR              Value, 
    int                 cch
) {
    PszStringCopy(Value, cch, L"Offline");
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID 
btnSkypePresenceOffline_Size(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    RibbonControlSize   *Value
) {
    *Value = RibbonControlSize_Large;
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID 
btnSkypePresenceOffline_Screentip(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    LPWSTR              Value, 
    int                 cch
) {
    PszStringCopy(Value, cch, L"Offline");
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID 
btnSkypePresenceOffline_Supertip(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    LPWSTR              Value, 
    int                 cch
) {
    PszStringCopy(Value, cch, L"Set presence to Offline");
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID 
btnSkypePresenceOffline_ImageMso(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    LPWSTR              Value, 
    int                 cch
) {
    *Value = L'\0';
    return;
    UNREFERENCED_PARAMETER(cch);
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID 
btnSkypePresenceOffline_Image(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    IDispatch           **Value
) {
    XAddin* pAddin = (XAddin *)Element->Context;

    *Value = NULL;

    if(pAddin->SkypeInfo.BmpPresenceOffline != NULL) {
        IPictureDisp*   pPictureDisp = NULL;
        PICTDESC        PictureDesc  = {0};
        HRESULT         hrRes;

        PictureDesc.cbSizeofstruct  = sizeof(PictureDesc);
	    PictureDesc.picType         = PICTYPE_BITMAP;
	    PictureDesc.bmp.hbitmap     = pAddin->SkypeInfo.BmpPresenceOffline;

        hrRes = OleCreatePictureIndirect(&PictureDesc, 
                                         &IID_IPictureDisp, 
                                         FALSE, 
                                         (void **)&pPictureDisp
                                        );
        if(pPictureDisp != NULL) {
            IPictureDisp_QueryInterface(pPictureDisp, 
                                        &IID_IDispatch, 
                                        (void **)Value
                                       );
            IPictureDisp_Release(pPictureDisp);
        }
    }

    return;
    UNREFERENCED_PARAMETER(Control);
}

static
VOID 
btnSkypePresenceOffline_Enabled(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    BOOL                *Value
) {
    *Value = TRUE;
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Element);
}

static
VOID 
btnSkypePresenceOffline_Pressed(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    BOOL                *Value
) {
    XAddin* pAddin = (XAddin *)Element->Context;
    *Value = pAddin->SkypeInfo.Presence == SKYPEPRESENCE_OFFLINE;

    return;
    UNREFERENCED_PARAMETER(Control);
}

static
VOID
btnSkypePresenceOffline_Action2(
    RibbonElement       *Element, 
    IDispatch           *Control, 
    BOOL                Pressed
) {
    XAddin* pAddin = (XAddin *)Element->Context;

    //if(pAddin->SkypeInfo.Presence == SKYPEPRESENCE_OFFLINE) {
    //    return;
    //}
    pAddin->SetSkypePresenceStatus(pAddin, SKYPEPRESENCE_OFFLINE);
    return;
    UNREFERENCED_PARAMETER(Control);
    UNREFERENCED_PARAMETER(Pressed);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader BitDefender
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions