Sets a visual object as the new root object of a visual tree.
HRESULT SetRoot( IDCompositionVisual *visual );
The visual object that is the new root of this visual tree. This parameter can be NULL.
If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See DirectComposition Error Codes for a list of error codes.
A visual can be either the root of a single visual tree, or a child of another visual, but it cannot be both at the same time. This method fails if the visual parameter is already the root of another visual tree, or is a child of another visual.
If visual is NULL, the visual tree is empty. If there was a previous non-NULL root visual, that visual becomes available for use as the root of another visual tree, or as a child of another visual.
For an example, see How to Build a Simple Visual Tree.
|Minimum supported client||Windows 8 [desktop apps only]|
|Minimum supported server||Windows Server 2012 [desktop apps only]|