Fixed app crashes when PC is locked

This commit is contained in:
Alexander 2019-10-28 20:33:14 +02:00
parent f98b4bb732
commit 6c4a4ed11b

View file

@ -36,9 +36,16 @@ protected override void WndProc(ref Message m)
{
const int WM_SYSCOMMAND = 0x112;
const int SC_MINIMIZE = 0xF020;
if (m.Msg == WM_SYSCOMMAND & m.WParam.ToInt32() == SC_MINIMIZE & settings.autoLock & !string.IsNullOrEmpty(PublicVar.encryptionKey.Get()))
try
{
richTextBox.Visible = false;
if (m.Msg == WM_SYSCOMMAND & m.WParam.ToInt32() == SC_MINIMIZE & settings.autoLock & !string.IsNullOrEmpty(PublicVar.encryptionKey.Get()))
{
richTextBox.Visible = false;
}
}
catch (OverflowException)
{
}
base.WndProc(ref m);
}