Attempts to retrieve a window handle from a Component Object Model (COM) object by querying for various interfaces that have a GetWindow method.
LWSTDAPI IUnknown_GetWindow( IUnknown *punk, HWND *phwnd );
A pointer to the COM object from which this function will attempt to obtain a window handle.
A pointer to a HWND that, when this function returns successfully, receives the window handle. If a window handle was not obtained, this parameter is set to NULL.
Returns S_OK if a window handle was successfully returned, or a COM error code otherwise. If no suitable interface was found, the function returns E_NOINTERFACE. Otherwise, the function returns the HRESULT returned by the corresponding interface's GetWindow method.
This function attempts to retrieve the window handle by calling IOleWindow::GetWindow, IInternetSecurityMgrSite::GetWindow, and IShellView::GetWindow. It is possible that future versions of IUnknown_GetWindow may attempt additional interfaces.
|Minimum supported client||Windows 2000 Professional, Windows XP [desktop apps only]|
|Minimum supported server||Windows 2000 Server, Windows Server 2003 [desktop apps only]|
|DLL||Shlwapi.dll (version 5.0 or later)|