A Win32 window.
상속: IWin32Window, IDisposable
예제 #1
0
        /// <summary>Gets the IWin32 window.</summary>
        /// <param name="visual">The visual object.</param>
        /// <returns>The Win32 Window.</returns>
        internal static IWin32Window GetIWin32Window(this Visual visual)
        {
            var source = PresentationSource.FromVisual(visual) as HwndSource;
            if (source != null)
            {
                var win = new Win32Window(source.Handle);
                Win32Window window = win;
                win.Dispose();
                return window;
            }

            return null;
        }