Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 3.45 KB

nf-shlwapi-iunknown_getwindow.md

File metadata and controls

82 lines (65 loc) · 3.45 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shlwapi.IUnknown_GetWindow
IUnknown_GetWindow function (shlwapi.h)
Attempts to retrieve a window handle from a Component Object Model (COM) object by querying for various interfaces that have a GetWindow method.
IUnknown_GetWindow
IUnknown_GetWindow function [Windows Shell]
_win32_IUnknown_GetWindow
shell.IUnknown_GetWindow
shlwapi/IUnknown_GetWindow
shell\IUnknown_GetWindow.htm
shell
f8a6f61f-bea3-4049-89fb-c33ef00b327f
12/05/2018
IUnknown_GetWindow, IUnknown_GetWindow function [Windows Shell], _win32_IUnknown_GetWindow, shell.IUnknown_GetWindow, shlwapi/IUnknown_GetWindow
shlwapi.h
Windows
Windows 2000 Professional, Windows XP [desktop apps only]
Windows 2000 Server, Windows Server 2003 [desktop apps only]
Shlwapi.dll (version 5.0 or later)
Windows
19H1
IUnknown_GetWindow
shlwapi/IUnknown_GetWindow
c++
APIRef
kbSyntax
DllExport
Shlwapi.dll
API-MS-Win-shlwapi-Winrt-storage-l1-1-0.dll
api-ms-win-shlwapi-winrt-storage-l1-1-1.dll
IUnknown_GetWindow

IUnknown_GetWindow function

-description

Attempts to retrieve a window handle from a Component Object Model (COM) object by querying for various interfaces that have a GetWindow method.

-parameters

-param punk [in]

Type: IUnknown*

A pointer to the COM object from which this function will attempt to obtain a window handle.

-param phwnd [out]

Type: HWND*

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

Type: HRESULT

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.

-remarks

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.

Note  The query for IShellView is theoretically unnecessary because IShellView derives from IOleWindow. The function explicitly queries for this interface because some objects implement QueryInterface incorrectly and fail to respond to a query for the base interface.