Пример #1
0
// @pymethod |PyICustomDestinationList|CommitList|Finalizes changes.
PyObject *PyICustomDestinationList::CommitList(PyObject *self, PyObject *args)
{
	ICustomDestinationList *pICDL = GetI(self);
	if ( pICDL == NULL )
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pICDL->CommitList( );
	PY_INTERFACE_POSTCALL;

	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pICDL, IID_ICustomDestinationList );
	Py_INCREF(Py_None);
	return Py_None;
}
// Builds a new custom Jump List for this application.
void CreateJumpList()
{
    // Create the custom Jump List object.
    ICustomDestinationList *pcdl;
    HRESULT hr = CoCreateInstance(CLSID_DestinationList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pcdl));
    if (SUCCEEDED(hr))
    {
        // Custom Jump Lists follow a push model - applications are responsible for providing an updated
        // list anytime the contents should be changed.  Lists are generated in a list-building
        // transaction that starts by calling BeginList.  Until the list is committed, Windows will
        // display the previous version of the list, if available.
        //
        // The cMinSlots out parameter indicates the minimum number of items that the Jump List UI is
        // guaranteed to display.  Applications can provide more items when building a custom Jump List,
        // but the extra items may not be displayed.  The number is dependant upon a number of factors,
        // such as screen resolution and the "Number of recent items to display in Jump Lists" user setting.
        // See the MSDN documentation on BeginList for more information.
        //
        // The IObjectArray returned from BeginList contains a list of items the user has chosen to remove
        // from their Jump List.  Applications must respect the user's removal of an item and not re-add any
        // item in the removed list during this list-building transaction.  Applications should also clear any
        // persited usage-tracking data for any item in the removed list.  If the user begins using a
        // previously removed item in the future, it may be re-added to the list.
        UINT cMinSlots;
        IObjectArray *poaRemoved;
        hr = pcdl->BeginList(&cMinSlots, IID_PPV_ARGS(&poaRemoved));
        if (SUCCEEDED(hr))
        {
            // Add content to the Jump List.
            hr = _AddCategoryToList(pcdl, poaRemoved);
            if (SUCCEEDED(hr))
            {
                hr = _AddTasksToList(pcdl);
                if (SUCCEEDED(hr))
                {
                    // Commit the list-building transaction.
                    hr = pcdl->CommitList();
                }
            }
            poaRemoved->Release();
        }
        pcdl->Release();
    }
}
Пример #3
0
bool wxTaskBarJumpListImpl::CommitUpdate()
{
    m_objectArray->Release();
    return SUCCEEDED(m_destinationList->CommitList());
}