Пример #1
0
LRESULT CActiveXWnd::OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    IOleObject* pUnk = NULL;
    m_pOwner->m_pOwner->GetControl(IID_IOleObject, (LPVOID*) &pUnk);
    if( pUnk == NULL ) return 0;
    CSafeRelease<IOleObject> RefOleObject = pUnk;
    DWORD dwMiscStatus = 0;
    pUnk->GetMiscStatus(DVASPECT_CONTENT, &dwMiscStatus);
    if( (dwMiscStatus & OLEMISC_NOUIACTIVATE) != 0 ) return 0;
    if( !m_pOwner->m_bInPlaceActive ) DoVerb(OLEIVERB_INPLACEACTIVATE);
    bHandled = FALSE;
    return 0;
}
Пример #2
0
// @pymethod |PyIOleObject|GetMiscStatus|Description of GetMiscStatus.
PyObject *PyIOleObject::GetMiscStatus(PyObject *self, PyObject *args)
{
	IOleObject *pIOO = GetI(self);
	if ( pIOO == NULL )
		return NULL;
	// @pyparm int|dwAspect||Description for dwAspect
	DWORD dwAspect;
	DWORD pdwStatus;
	if ( !PyArg_ParseTuple(args, "i:GetMiscStatus", &dwAspect) )
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pIOO->GetMiscStatus( dwAspect, &pdwStatus );
	PY_INTERFACE_POSTCALL;

	if ( FAILED(hr) )
		return OleSetOleError(hr);

	PyObject *pyretval = Py_BuildValue("i", pdwStatus);
	return pyretval;
}