コード例 #1
0
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == winuser_h.WM_SYSCOMMAND && notifyWindow != null)
            {
                if (m.WParam.ToInt32() == winuser_h.SC_MINIMIZE)
                {
                    notifyWindow.Owner = null;

                    this.InvokeIfRequired(() => Win32ApiHelper.ShowWindow(Handle, winuser_h.SW_HIDE));
                    ShowInTaskbar = false;
                }
                if (m.WParam.ToInt32() == winuser_h.SC_RESTORE)
                {
                    notifyWindow.Owner       = null;
                    notifyWindow.WindowState = FormWindowState.Normal;
                }
            }
            base.WndProc(ref m);
        }