Share via


GweBypassCoredllThunk_t::SetParent_I (Windows Embedded CE 6.0)

1/6/2010

This method changes the parent window of the specified child window.

Syntax

static HWND WINAPI SetParent_I(
  HWND hwndThis,
  HWND hwndNewParent
);

Parameters

  • hwndThis
    [in] Handle to the child window.
  • hwndNewParent
    [in] Handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent window.

    If this parameter is HWND_MESSAGE, the child window becomes a message-only window.

Return Value

A handle to the previous parent window indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

This method is an internal version of the SetParent function.

An application can use the GweBypassCoredllThunk_t::SetParent_I method to set the parent window of a pop-up, overlapped, or child window. The new parent window and the child window must belong to the same application.

If the window identified by the hWndChild parameter is visible, the system performs the appropriate redrawing and repainting.

For compatibility reasons, GweBypassCoredllThunk_t::SetParent_I does not modify the WS_CHILD or WS_POPUP window styles of the window for which the parent is being changed. Therefore, if hWndNewParent is NULL, you should also clear the WS_CHILD bit and set the WS_POPUP style after calling GweBypassCoredllThunk_t::SetParent_I. Conversely, if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling GweBypassCoredllThunk_t::SetParent_I.

Requirements

Header gwebypasscoredllthunk.hpp
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

GweBypassCoredllThunk_t
SetParent
GweBypassCoredllThunk_t::GetParent_I