Example #1
0
        //private Dictionary<IntPtr, InfoWindow> backgroundWindows = new Dictionary<IntPtr, InfoWindow>();

        private void toolStripMenuItem3_DropDownOpening(object sender, EventArgs e)
        {
            var backgroundWindows = RunningWindows.GetBackgroundWindows();

            if (backgroundWindows.Any())
            {
                toolStripMenuItem3.DropDownItems.Clear();

                foreach (var kvp in backgroundWindows)
                {
                    var moveToForeground = new ToolStripButton(kvp.Value.Title);
                    moveToForeground.Click += (o, args) =>
                    {
                        RunningWindows.SetParent(kvp.Key, IntPtr.Zero);
                    };
                    toolStripMenuItem3.DropDownItems.Add(moveToForeground);
                }
            }
        }
Example #2
0
        private void toolStripMenuItem2_DropDownOpening(object sender, EventArgs e)
        {
            var windows = RunningWindows.GetOpenedWindows();

            if (windows.Any())
            {
                toolStripMenuItem2.DropDownItems.Clear();

                foreach (var kvp in windows)
                {
                    var moveToBackground = new ToolStripButton(kvp.Value.Title);
                    moveToBackground.Click += (o, args) =>
                    {
                        RunningWindows.SetParent(kvp.Key, RunningWindows.GetOrCreateBackground());
                        //backgroundWindows[kvp.Key] = kvp.Value;
                    };
                    toolStripMenuItem2.DropDownItems.Add(moveToBackground);
                }
            }
        }