コード例 #1
0
        /**
         * <summary>
         * 現在のアクティヴモニターをその整列方法に基づいて整列しなおす
         * </summary>
         */
        public void ArrangeWindows()
        {
            var windowManager = this.monitorManager.GetCurrentMonitorWindowManager();

            windowManager.RemoveInvisibleWindows();
            var monitorInfoWithHandle = this.monitorManager.GetCurrentMonitor();
            var windowTiler           = new WindowTiler(
                /* windowTilingType =  */ windowManager.windowTilingType,
                /* windowCount =  */ windowManager.WindowCount(),
                /* monitorRect = */ monitorInfoWithHandle.monitorInfo.work);

            windowManager.ArrangeWindows(windowTiler);
        }
コード例 #2
0
        /**
         * <summary>
         * 複数の WindowInfoWithHandleを各モニターごとに管理する
         * </summary>
         * <param name="windowInfoWithHandles"></param>
         */
        public void ManageWindowByMonitors(List <WindowInfoWithHandle> windowInfoWithHandles)
        {
            this.windowManagers.Clear();

            foreach (var monitorInfo in this.monitorInfos)
            {
            }

            for (int i = 0; i < this.monitorInfos.Count; i++)
            {
                var monitorInfo   = this.monitorInfos[i];
                var monitorHandle = monitorInfo.monitorHandle;
                var monitorName   = new string(monitorInfo.monitorInfo.szDevice).TrimEnd('\0');
                Logger.WriteLine($"Add WindowManager of Monitor : {monitorName} ({monitorHandle})");
                var windowManager = new WindowManager(monitorInfo.monitorHandle);
                windowManager.windowTilingType = (WindowTilingType)SettingManager.GetInt($"Window_WindowManager{i}_WindowTilingType");
                this.windowManagers.Add(windowManager);
            }

            foreach (var windowInfoWithHandle in windowInfoWithHandles)
            {
                this.AddWindowInfo(windowInfoWithHandle);
            }

            // 全画面を初期状態で整列する
            foreach (var windowManager in this.windowManagers)
            {
                var monitorHandle         = windowManager.monitorHandle;
                var monitorInfoWithHandle = this.FindMonitorInfoByMonitorHandle(monitorHandle);
                var windowTiler           = new WindowTiler(
                    /* windowTilingType =  */ windowManager.windowTilingType,
                    /* windowCount =  */ windowManager.WindowCount(),
                    /* monitorRect = */ monitorInfoWithHandle.monitorInfo.work);
                windowManager.ArrangeWindows(windowTiler);
                windowManager.MoveCurrentFocusTop();
            }

            this.SetCurrentWindowManagerIndex(0);
            this.ActivateWindow();
        }