コード例 #1
0
        protected override void WndProc(ref Message msg)
        {
            if (msg.Msg == (int)Utils.SystemMenu.WindowMessages.wmSysCommand)
            {
                switch (msg.WParam.ToInt32())
                {
                case DECOUPLE_WINDOW_ID:
                    Decouple();
                    reloadSystemMenu();
                    break;

                case DOCK_WINDOW_ID:
                    Framework.Interfaces.IPluginUIMainWindow mainPlugin = (from Framework.Interfaces.IPlugin a in Core.GetPlugin(Framework.PluginType.UIMainWindow) select a).FirstOrDefault() as Framework.Interfaces.IPluginUIMainWindow;
                    if (mainPlugin != null)
                    {
                        this.MdiParent = mainPlugin.MainForm;
                    }
                    if (UtilsSettings.Instance.DecoupledChildWindows.Contains(this.GetType().FullName))
                    {
                        UtilsSettings.Instance.DecoupledChildWindows.Remove(this.GetType().FullName);
                    }
                    reloadSystemMenu();
                    CouplingToMainScreenChanged();
                    break;

                case TOPMOST_WINDOW_ID:
                    //can only be topmost if decoupled
                    Decouple();
                    this.TopMost = true;
                    if (!UtilsSettings.Instance.TopMostWindows.Contains(this.GetType().FullName))
                    {
                        UtilsSettings.Instance.TopMostWindows.Add(this.GetType().FullName);
                    }
                    reloadSystemMenu();
                    break;

                case NOTTOPMOST_WINDOW_ID:
                    this.TopMost = false;
                    if (UtilsSettings.Instance.TopMostWindows.Contains(this.GetType().FullName))
                    {
                        UtilsSettings.Instance.TopMostWindows.Remove(this.GetType().FullName);
                    }
                    reloadSystemMenu();
                    break;

                case OPAQUEWHENIACTIVE_WINDOW_ID:
                    BaseUIChildWindowTransparencyForm dlg = new BaseUIChildWindowTransparencyForm();
                    dlg.TopMost = true;
                    dlg.Show();
                    break;
                }
            }
            base.WndProc(ref msg);
        }
コード例 #2
0
 protected override void WndProc(ref Message msg)
 {
     if (msg.Msg == (int)Utils.SystemMenu.WindowMessages.wmSysCommand)
     {
         switch (msg.WParam.ToInt32())
         {
             case DECOUPLE_WINDOW_ID:
                 Decouple();
                 reloadSystemMenu();
                 break;
             case DOCK_WINDOW_ID:
                 Framework.Interfaces.IPluginUIMainWindow mainPlugin = (from Framework.Interfaces.IPlugin a in Core.GetPlugin(Framework.PluginType.UIMainWindow) select a).FirstOrDefault() as Framework.Interfaces.IPluginUIMainWindow;
                 if (mainPlugin != null)
                 {
                     this.MdiParent = mainPlugin.MainForm;
                 }
                 if (UtilsSettings.Instance.DecoupledChildWindows.Contains(this.GetType().FullName))
                 {
                     UtilsSettings.Instance.DecoupledChildWindows.Remove(this.GetType().FullName);
                 }
                 reloadSystemMenu();
                 CouplingToMainScreenChanged();
                 break;
             case TOPMOST_WINDOW_ID:
                 //can only be topmost if decoupled
                 Decouple();
                 this.TopMost = true;
                 if (!UtilsSettings.Instance.TopMostWindows.Contains(this.GetType().FullName))
                 {
                     UtilsSettings.Instance.TopMostWindows.Add(this.GetType().FullName);
                 }
                 reloadSystemMenu();
                 break;
             case NOTTOPMOST_WINDOW_ID:
                 this.TopMost = false;
                 if (UtilsSettings.Instance.TopMostWindows.Contains(this.GetType().FullName))
                 {
                     UtilsSettings.Instance.TopMostWindows.Remove(this.GetType().FullName);
                 }
                 reloadSystemMenu();
                 break;
             case OPAQUEWHENIACTIVE_WINDOW_ID:
                 BaseUIChildWindowTransparencyForm dlg = new BaseUIChildWindowTransparencyForm();
                 dlg.TopMost = true;
                 dlg.Show();
                 break;
         }
     }
     base.WndProc(ref msg);
 }