IXRWin32Control::SetHandle (Windows Embedded CE 6.0)
1/6/2010
This method sets an existing window handle as the new handle for an IXRWin32Control object, so that the IXRWin32Control object represents a child window control of the visual host window.
Syntax
virtual HRESULT STDMETHODCALLTYPE SetHandle(
HWND Handle,
boolDestroyPreviousWindow
) = 0;
Parameters
- Handle
[in] Handle to the window control that is returned by CreateWindow or CreateWindowEx.
- DestroyPreviousWindow
[in] Boolean that indicates whether to send a WM_DESTROY message to the previous window for this control and destroy its handle before Silverlight for Windows Embedded sets the new handle.
Return Value
Returns an HRESULT that indicates success or failure.
Remarks
Before this method sets the HWND specified in Handle, it removes any previous handle to this window control from the cache and sets the handle to its parent window to Null.
Silverlight uses the DestroyPreviousWindow parameter when it replaces one Win32 control handle with another one at run time. For example, consider a predefined Win32 control defined in the source XAML. At run time, if you have some programming logic that replaces the predefined Win32 control with a new Win32 control and you no longer need the predefined Win32 control in your application, you can call SetHandle to replace the predefined Win32 control with the new one, passing in DestroyPreviousWindow as true in order to destroy the predefined Win32 window handle.
When this occurs, the new Win32 control with the new handle automatically goes into the exact same location as the predefined control in the visual tree and inherits all existing behaviors for the predefined Win32 control, such as animation storyboards.
.NET Framework Equivalent
None.
Requirements
Header | XamlRuntime.h |
sysgen | SYSGEN_XAML_RUNTIME |
Windows Embedded CE | Windows Embedded CE 6.0 R3 |
See Also
Tasks
Add a Window Control to a Silverlight for Windows Embedded Application