From dd1b5216e666acf770c46bd542d9642f28a5601a Mon Sep 17 00:00:00 2001 From: Poerin Date: Mon, 27 Sep 2021 15:20:54 +0800 Subject: [PATCH] 2021-09-27 --- Stroke/Stroke.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Stroke/Stroke.cs b/Stroke/Stroke.cs index 51e533e..7f3bcb0 100644 --- a/Stroke/Stroke.cs +++ b/Stroke/Stroke.cs @@ -44,7 +44,6 @@ private void InitializeComponent() ShowInTaskbar = false; StartPosition = FormStartPosition.Manual; TransparencyKey = Color.Black; - Visible = false; ResumeLayout(false); } @@ -90,8 +89,8 @@ private bool MouseHook_MouseAction(MouseHook.MouseActionArgs args) } stroking = true; - TopMost = true; - Visible = true; + API.SetWindowPos(Handle, API.IA.TOPMOST, 0, 0, 0, 0, API.SWP.NOSIZE | API.SWP.NOMOVE | API.SWP.NOACTIVATE); + API.ShowWindow(Handle, API.SW.SHOWNOACTIVATE); lastPoint = args.Location; drwaingPoints.Add(args.Location); return true; @@ -101,8 +100,8 @@ private bool MouseHook_MouseAction(MouseHook.MouseActionArgs args) stroking = false; draw.Clear(); Refresh(); - Visible = false; - TopMost = false; + API.ShowWindow(Handle, API.SW.HIDE); + API.SetWindowPos(Handle, API.IA.NOTOPMOST, 0, 0, 0, 0, API.SWP.NOSIZE | API.SWP.NOMOVE | API.SWP.NOACTIVATE); if (filtering) {