From 6606caf589ef2a5e65202abab5507b546b0d38c3 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 15 Oct 2019 20:13:07 +0300 Subject: [PATCH] When auto lock on minimize, editor text was visible in windows taskbar --- Crypto Notepad/MainForm.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index ffa4730..a2dc46c 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -31,6 +31,17 @@ public MainForm() richTextBox.AllowDrop = true; } + 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())) + { + richTextBox.Visible = false; + } + base.WndProc(ref m); + } + #region Methods private void DecryptAES() {