This commit is contained in:
NaBian committed 2021-03-28 13:06:21 +08:00
1 parent ad83effdfe
commit ad32fc889f
1 file changed
+24 -27
@@ -578,37 +578,34 @@ namespace HandyControl.Controls
private IntPtr Callback(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam) private IntPtr Callback(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
{ {
if (IsLoaded) if (msg == _wmTaskbarCreated)
{ {
if (msg == _wmTaskbarCreated) if (_messageWindowHandle == hWnd && Visibility == Visibility.Visible)
{ {
if (_messageWindowHandle == hWnd && Visibility == Visibility.Visible) UpdateIcon(true);
{
UpdateIcon(true);
}
} }
else }
else
{
switch (lparam.ToInt64())
{ {
switch (lparam.ToInt64()) case InteropValues.WM_LBUTTONDBLCLK:
{ WmMouseDown(MouseButton.Left, 2);
case InteropValues.WM_LBUTTONDBLCLK: break;
WmMouseDown(MouseButton.Left, 2); case InteropValues.WM_LBUTTONUP:
break; WmMouseUp(MouseButton.Left);
case InteropValues.WM_LBUTTONUP: break;
WmMouseUp(MouseButton.Left); case InteropValues.WM_RBUTTONUP:
break; ShowContextMenu();
case InteropValues.WM_RBUTTONUP: WmMouseUp(MouseButton.Right);
ShowContextMenu(); break;
WmMouseUp(MouseButton.Right); case InteropValues.WM_MOUSEMOVE:
break; if (!_dispatcherTimerPos.IsEnabled)
case InteropValues.WM_MOUSEMOVE: {
if (!_dispatcherTimerPos.IsEnabled) _dispatcherTimerPos.Interval = TimeSpan.FromMilliseconds(200);
{ _dispatcherTimerPos.Start();
_dispatcherTimerPos.Interval = TimeSpan.FromMilliseconds(200); }
_dispatcherTimerPos.Start(); break;
}
break;
}
} }
} }