关闭到托盘

This commit is contained in:
陈国伟 2021-11-01 17:18:32 +08:00
parent ce6e4ed600
commit a1339cfdf9

View File

@ -85,11 +85,15 @@ namespace FastGithub.UI
{ {
const int WM_SYSCOMMAND = 0x112; const int WM_SYSCOMMAND = 0x112;
const int SC_MINIMIZE = 0xf020; const int SC_MINIMIZE = 0xf020;
const int SC_CLOSE = 0xf060;
if (msg == WM_SYSCOMMAND && wParam.ToInt32() == SC_MINIMIZE) if (msg == WM_SYSCOMMAND)
{ {
this.Hide(); if (wParam.ToInt32() == SC_MINIMIZE || wParam.ToInt32() == SC_CLOSE)
handled = true; {
this.Hide();
handled = true;
}
} }
return IntPtr.Zero; return IntPtr.Zero;
} }