Autosave on lock

This commit is contained in:
Alexander 2019-09-28 22:55:21 +03:00
parent 3b9b930667
commit 157b148e85

View file

@ -34,7 +34,23 @@ public MainForm()
RichTextBox.AllowDrop = true;
}
/*Functions*/
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 && PublicVar.encryptionKey.Get() != null)
{
SaveMainMenu_Click(this, new EventArgs());
AutoLock(true);
return;
}
base.WndProc(ref m);
}
#region Functions
private void DecryptAES()
{
EnterKeyForm f2 = new EnterKeyForm();