Skip to content

Commit 1f2d495

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/add-BalloonTipClicked-event-to-nofifyicon
2 parents c5f383f + 64da563 commit 1f2d495

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public class NotifyIcon : FrameworkElement, IDisposable
3434

3535
private IconHandle _iconHandle;
3636

37-
private const int WmTrayMouseMessage = InteropValues.WM_USER + 1024;
38-
3937
private string _windowClassName;
4038

4139
private int _wmTaskbarCreated;
@@ -494,7 +492,7 @@ private void UpdateIcon(bool showIconInTray, bool isTransparent = false)
494492
_isTransparent = isTransparent;
495493
var data = new InteropValues.NOTIFYICONDATA
496494
{
497-
uCallbackMessage = WmTrayMouseMessage,
495+
uCallbackMessage = InteropValues.WM_TRAYMOUSEMESSAGE,
498496
uFlags = InteropValues.NIF_MESSAGE | InteropValues.NIF_ICON | InteropValues.NIF_TIP,
499497
hWnd = _messageWindowHandle,
500498
uID = _id,
@@ -578,7 +576,7 @@ private IntPtr Callback(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
578576
}
579577
break;
580578
case InteropValues.NIN_BALLOONUSERCLICK:
581-
RaiseEvent(new RoutedEventArgs(BalloonTipClickedEvent));
579+
RaiseEvent(new RoutedEventArgs(BalloonTipClickEvent));
582580
break;
583581
}
584582
}
@@ -676,14 +674,14 @@ public event RoutedEventHandler MouseDoubleClick
676674
remove => RemoveHandler(MouseDoubleClickEvent, value);
677675
}
678676

679-
public static readonly RoutedEvent BalloonTipClickedEvent =
680-
EventManager.RegisterRoutedEvent("BalloonTipClicked", RoutingStrategy.Bubble,
681-
typeof(RoutedEventHandler), typeof(NotifyIcon));
677+
public static readonly RoutedEvent BalloonTipClickEvent =
678+
EventManager.RegisterRoutedEvent("BalloonTipClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler),
679+
typeof(NotifyIcon));
682680

683-
public event RoutedEventHandler BalloonTipClicked
681+
public event RoutedEventHandler BalloonTipClick
684682
{
685-
add => AddHandler(BalloonTipClickedEvent, value);
686-
remove => RemoveHandler(BalloonTipClickedEvent, value);
683+
add => AddHandler(BalloonTipClickEvent, value);
684+
remove => RemoveHandler(BalloonTipClickEvent, value);
687685
}
688686

689687
private void UpdateDataContext(FrameworkElement target, object oldValue, object newValue)

src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ internal const int
8484
MF_BYPOSITION = 0x400,
8585
MF_GRAYED = 0x00000001,
8686
MF_SEPARATOR = 0x800,
87+
NIN_BALLOONUSERCLICK = WM_USER + 5,
8788
TB_GETBUTTON = WM_USER + 23,
8889
TB_BUTTONCOUNT = WM_USER + 24,
8990
TB_GETITEMRECT = WM_USER + 29,
91+
WM_TRAYMOUSEMESSAGE = WM_USER + 1024,
9092
VERTRES = 10,
9193
DESKTOPVERTRES = 117,
9294
LOGPIXELSX = 88,

0 commit comments

Comments
 (0)