Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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 VIEWSTATUSenumeration 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::GetViewStatusmethod 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.

An object should notify its sites when it changes using the IAdviseSinkEx::OnViewStatusChangemethod so the sites can cache this information for high-speed access.

Objects not supporting the IViewObjectExinterface are considered to be always transparent.

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

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

The IViewObjectEx::GetViewStatusmethod 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
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also