Freigeben über


IContactManagerInterop::ShowContactCardForWindow method

Displays the UI for a contact on the specified window.

Syntax

HRESULT ShowContactCardForWindow(
  [in] HWND             appWindow,
  [in] IUnknown         *contact,
  [in] Rect             selection,
  [in] FLYOUT_PLACEMENT preferredPlacement
);

Parameters

  • appWindow [in]
    Type: HWND

    The HWND of the foreground window of the app from which the contact card is launched and where focus is returned when the contact card is dismissed.

  • contact [in]
    Type: IUnknown*

    A pointer to the contact object. Use a Windows.ApplicationModel.Contacts.Contact object but cast to IUnknown here because classic COM IDL can't use Windows Runtime types.

  • selection [in]
    Type: Rect

    The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the contact card, not within that rectangular area. For example, if an app uses a button to show the contact card, pass the Rect of the button so the contact card displays around the button, not overlapping it.

  • preferredPlacement [in]
    Type: FLYOUT_PLACEMENT

    A FLYOUT_PLACEMENT-typed value that describes the preferred placement of the contact card.

    Value Meaning
    FP_DEFAULT 0

    Use the default.

    FP_ABOVE ( FP_DEFAULT + 1 )

    Prefer to place the contact card above the rectangular area of user selection specified by the selection parameter.

    FP_BELOW ( FP_ABOVE + 1 )

    Prefer to place the contact card below the rectangular area of user selection specified by the selection parameter.

    FP_LEFT ( FP_BELOW + 1 )

    Prefer to place the contact card to the left of the rectangular area of user selection specified by the selection parameter.

    FP_RIGHT ( FP_LEFT + 1 )

    Prefer to place the contact card to the right of the rectangular area of user selection specified by the selection parameter.

     

Return value

Type: HRESULT

ShowContactCardForWindow returns:

  • S_OK if the contact card is successfully displayed
  • E_POINTER if appWindow is NULL or contact is NULL or selection is NULL
  • E_INVALIDARG if contact isn't a Windows.ApplicationModel.Contacts.Contact object or preferredPlacement is an invalid enumeration value

Other HRESULT values are possible.

Remarks

Default browsers use ShowContactCardForWindow to specify an HWND from which the contact card is launched and where focus is returned when the contact card is dismissed.

Requirements

Minimum supported client

Windows 8.1 [desktop apps only]

Minimum supported server

Windows Server 2012 R2 [desktop apps only]

Header

Shobjidl_core.h

IDL

Shobjidl.idl

See also

IContactManagerInterop

ContactManager.ShowContactCard