Returns the HwndSource object of the specified window.
Assembly: PresentationCore (in PresentationCore.dll)
This method is not available in the Internet security zone, or for partial trust in general.
You can use this method to return an HwndSource for a window that is not explicitly an interoperation window. The procedure for this is:
Pass that HWND value as a parameter to .
This technique can be useful if you then want to add general AddHook message processing to the window. However, whenever you create an HwndSource, you are also responsible for destroying it. This is true even if the Application object for an application HwndSource is disposed. For more information, see Remarks on HwndSource.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.