次の方法で共有


IViewObjectEx::GetViewStatus (Compact 2013)

3/26/2014

This method returns information about the opacity of the object and what drawing aspects are supported.

Syntax

HRESULT GetViewStatus(
  DWORD* pdwStatus
);

Parameters

  • pdwStatus
    [out] Pointer to the view status. This information is returned as a combination of the VIEWSTATUS enumeration values.

Return Value

If method returns S_OK, the view status was successfully returned. This method should never fail or return an error code.

Remarks

To optimize the drawing process, the container needs to be able to determine whether an object is opaque and has a solid background. It is not necessary to redraw objects that are entirely covered by a completely opaque object. Other operations, such as scrolling, can also be highly optimized if an object is opaque and has a solid background.

The IViewObjectEx::GetViewStatus method returns whether the object is entirely opaque (VIEWSTATUS_OPAQUE bit) and whether its background is solid (VIEWSTATUS_SOLIDBKGND bit).

This information can change in time.

An object can be opaque at a given time and become totally or partially transparent later on, for example, because of a change of the BackStyle property.

Objects not supporting the IViewObjectEx interface are considered to be always transparent.

The IViewObjectEx::GetViewStatus method also returns a combination of bits indicating which aspects are supported.

If a given drawing aspect is not supported, all IViewObjectEx methods taking a drawing aspect as an input parameter should fail and return E_INVALIDARG.

The IViewObjectEx::GetViewStatus method allows the container to get back information about all drawing aspects in one quick call.

Usually, the set of supported drawing aspects should not change with time. However, if this was not the case, an object should notify its container using IAdviseSinkEx::OnViewStatusChange.

Which drawing aspects are supported is independent of whether the object is opaque, partially transparent, or totally transparent.

In particular, a transparent object that does not support DVASPECT_TRANSPARENT should be drawn correctly during the back-to-front pass using DVASPECT_CONTENT. However, this is likely to result in more flicker.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header

ocidl.h,
ocidl.idl

Library

ole32.lib,
uuid.lib

See Also

Reference

IViewObjectEx
VIEWSTATUS