mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Fixed app crashes when PC is locked
This commit is contained in:
parent
f98b4bb732
commit
6c4a4ed11b
1 changed files with 9 additions and 2 deletions
|
|
@ -36,9 +36,16 @@ protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
const int WM_SYSCOMMAND = 0x112;
|
const int WM_SYSCOMMAND = 0x112;
|
||||||
const int SC_MINIMIZE = 0xF020;
|
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);
|
base.WndProc(ref m);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue