IInitializeWithWindow::Initialize method (shobjidl_core.h)

Specifies an owner window to be used by a Windows Runtime (WinRT) object that is used in a desktop app.

For info and code examples about this method, see Display WinRT UI objects that depend on CoreWindow. In addition to the types listed in that topic, Shell data object is also associated with this API.


HRESULT Initialize(
  [in] HWND hwnd


[in] hwnd

The handle of the window to be used as the owner window.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also