示例#1
0
        internal CustomWindowsManager(ProxyWindow proxy, IntPtr hwndParent)
        {
            _hwnd        = proxy.RealWindow;
            _hwndParent  = hwndParent;
            _proxyWindow = proxy;//Just keep it alive
            _proxyWindow.WindowsManager = this;

            Windows7Taskbar.EnableCustomWindowPreview(WindowToTellDwmAbout);
        }
示例#2
0
        /// <summary>
        /// Creates a new instance of this class from the specified
        /// window handle and parent window handle.
        /// </summary>
        /// <param name="hwnd">The window handle.</param>
        /// <param name="parentHwnd">The parent window handle.</param>
        /// <returns>A new instance of this class wrapping the
        /// specified window handle and parent window handle.</returns>
        public static CustomWindowsManager CreateWindowsManager(
            IntPtr hwnd, IntPtr parentHwnd)
        {
            if (parentHwnd == IntPtr.Zero)
            {
                return(new CustomWindowsManager(hwnd));
            }

            ProxyWindow proxy = new ProxyWindow(hwnd);

            Windows7Taskbar.TaskbarList.UnregisterTab(parentHwnd);

            Windows7Taskbar.TaskbarList.RegisterTab(proxy.Handle, parentHwnd);
            Windows7Taskbar.TaskbarList.SetTabOrder(proxy.Handle, IntPtr.Zero);
            Windows7Taskbar.TaskbarList.ActivateTab(proxy.Handle);

            return(new CustomWindowsManager(proxy, parentHwnd));

            //TODO: Think about ordering
        }
示例#3
0
        internal CustomWindowsManager(ProxyWindow proxy, IntPtr hwndParent)
        {
            _hwnd = proxy.RealWindow;
            _hwndParent = hwndParent;
            _proxyWindow = proxy;//Just keep it alive
            _proxyWindow.WindowsManager = this;

            Windows7Taskbar.EnableCustomWindowPreview(WindowToTellDwmAbout);
        }
示例#4
0
        /// <summary>
        /// Creates a new instance of this class from the specified
        /// window handle and parent window handle.
        /// </summary>
        /// <param name="hwnd">The window handle.</param>
        /// <param name="parentHwnd">The parent window handle.</param>
        /// <returns>A new instance of this class wrapping the
        /// specified window handle and parent window handle.</returns>
        public static CustomWindowsManager CreateWindowsManager(
            IntPtr hwnd, IntPtr parentHwnd)
        {
            if (parentHwnd == IntPtr.Zero)
                return new CustomWindowsManager(hwnd);

            ProxyWindow proxy = new ProxyWindow(hwnd);

            Windows7Taskbar.TaskbarList.UnregisterTab(parentHwnd);

            Windows7Taskbar.TaskbarList.RegisterTab(proxy.Handle, parentHwnd);
            Windows7Taskbar.TaskbarList.SetTabOrder(proxy.Handle, IntPtr.Zero);
            Windows7Taskbar.TaskbarList.ActivateTab(proxy.Handle);
            
            return new CustomWindowsManager(proxy, parentHwnd);
            
            //TODO: Think about ordering
        }