예제 #1
0
        public void ShowAll(bool useDummy)
        {
            /// NotifyIconクリック時は一旦dummyをアクティブ化しないと
            /// 非アクティブ時にShowWindow()でfusenが前に出てこない
            var dummy = default(Form);

            if (useDummy)
            {
                dummy = new Form();
                dummy.ShowInTaskbar = false;
                dummy.StartPosition = FormStartPosition.Manual;
                dummy.Location      = new Point(-2000, -2000);
                dummy.Size          = new Size();
                dummy.WindowState   = FormWindowState.Minimized;
                dummy.Show();
                dummy.Activate();
            }

            foreach (var fusen in _infoToForms.Values)
            {
                //User32PI.SetForegroundWindow(fusen.Handle);
                User32PI.ShowWindow(fusen.Handle, WindowShowStyle.ShowNoActivate);
            }

            if (dummy != null)
            {
                dummy.Dispose();
            }
        }
예제 #2
0
        protected override void OnActivated(EventArgs e)
        {
            base.OnActivated(e);

            if (_isShown && _toolStripForm != null)
            {
                RelocateToolStripForm();
                User32PI.ShowWindow(_toolStripForm.Handle, WindowShowStyle.ShowNoActivate);
            }
        }
예제 #3
0
        // ------------------------------
        // private
        // ------------------------------
        private void InitToolStripForm(bool show)
        {
            _toolStripForm            = new ToolStripForm();
            _toolStripForm.TargetForm = this;
            InitDropDowns();
            InitMemoMarkToolStripSplitButton();

            InitToolStripHandlers();
            if (_toolStripForm._fontNameToolStripComboBox.Items.Count == 0)
            {
                _UILogic.InitFontNameToolStripComboBox(_toolStripForm._fontNameToolStripComboBox.ComboBox);
                _UILogic.InitFontSizeToolStripComboBox(_toolStripForm._fontSizeToolStripComboBox.ComboBox);
            }
            RelocateToolStripForm();
            UpdateToolStrip();
            if (show)
            {
                User32PI.ShowWindow(_toolStripForm.Handle, WindowShowStyle.ShowNoActivate);
            }
        }