From 8ec1a89941a08ae6d9e4ebf540c973f4bdfa37aa Mon Sep 17 00:00:00 2001 From: mshafer1 <2565361+mshafer1@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:46:08 -0600 Subject: [PATCH] create a constants class to manage flag names --- ntfysh_client/NotificationDialog.cs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ntfysh_client/NotificationDialog.cs b/ntfysh_client/NotificationDialog.cs index aac9b97..5962398 100644 --- a/ntfysh_client/NotificationDialog.cs +++ b/ntfysh_client/NotificationDialog.cs @@ -40,14 +40,22 @@ namespace ntfysh_client if (value) { this.BringToFront(); - AnimateWindow(this.Handle, 250, 0x00040000 | 0x00000008); + AnimateWindow( + this.Handle, + time: 250, + flags: NFWinUserAnimateWindowConstnats.AW_SLIDE | NFWinUserAnimateWindowConstnats.AW_VER_NEGATIVE + ); } base.SetVisibleCore(value); } private void ui_hide_window(object? sender, EventArgs e) { - AnimateWindow(this.Handle, 250, 0x00040000 | 0x00000004 | 0x00010000); + AnimateWindow( + this.Handle, + time: 250, + flags: NFWinUserAnimateWindowConstnats.AW_SLIDE | NFWinUserAnimateWindowConstnats.AW_VER_POSITIVE | NFWinUserAnimateWindowConstnats.AW_HIDE + ); this.IsVisible = false; } @@ -141,5 +149,17 @@ namespace ntfysh_client // immediate this.IsVisible = false; } + private class NFWinUserAnimateWindowConstnats + { + public const int AW_HOR_POSITIVE = 0x00000001; + public const int AW_HOR_NEGATIVE = 0x00000002; + public const int AW_VER_POSITIVE = 0x00000004; + public const int AW_VER_NEGATIVE = 0x00000008; + public const int AW_CENTER = 0x00000010; + public const int AW_HIDE = 0x00010000; + public const int AW_ACTIVATE = 0x00020000; + public const int AW_SLIDE = 0x00040000; + public const int AW_BLEND = 0x00080000; + } } }