IUnknown_GetWindow function
Attempts to retrieve a window handle from a Component Object Model (COM) object by querying for various interfaces that have a GetWindow method.
Syntax
HRESULT IUnknown_GetWindow( _In_ IUnknown *punk, _Out_ HWND *phwnd );
Parameters
- punk [in]
-
Type: IUnknown*
A pointer to the COM object from which this function will attempt to obtain a window handle.
- 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.
Return value
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.
Requirements
|
Minimum supported client |
Windows 2000 Professional, Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server, Windows Server 2003 [desktop apps only] |
|
Header |
|
|
DLL |
|