mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-11 01:03:32 +08:00
Compare commits
4 Commits
copilot/fi
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf21be62a | ||
|
|
35dc57006e | ||
|
|
d397e15a2c | ||
|
|
4bff62f4d8 |
@@ -169,7 +169,7 @@ void Shell32::getSelectedFromDesktop(PWCHAR buffer)
|
||||
&pwba))))
|
||||
return;
|
||||
|
||||
if (HelperMethods::IsCursorActivated(reinterpret_cast<HWND>(LongToHandle(phwnd))))
|
||||
if (HelperMethods::IsCursorActivated(0))
|
||||
return;
|
||||
|
||||
CComPtr<IServiceProvider> psp;
|
||||
|
||||
@@ -23,6 +23,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Wpf.Ui.Violeta.Win32;
|
||||
using ToolTipIcon = Wpf.Ui.Violeta.Win32.ToolTipIcon;
|
||||
@@ -149,9 +150,30 @@ internal partial class TrayIconManager : IDisposable
|
||||
Action closeEvent = null)
|
||||
{
|
||||
var icon = GetInstance()._icon;
|
||||
icon.ShowBalloonTip(timeout, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info);
|
||||
icon.BalloonTipClicked += OnIconOnBalloonTipClicked;
|
||||
icon.BalloonTipClosed += OnIconOnBalloonTipClosed;
|
||||
|
||||
try
|
||||
{
|
||||
// Use reflection to call ShowBalloonTip to avoid JIT compilation errors
|
||||
// when the method signature doesn't match the expected one
|
||||
var showBalloonTipMethod = icon.GetType().GetMethod("ShowBalloonTip",
|
||||
new[] { typeof(int), typeof(string), typeof(string), typeof(ToolTipIcon) });
|
||||
|
||||
if (showBalloonTipMethod != null)
|
||||
{
|
||||
showBalloonTipMethod.Invoke(icon, new object[] { timeout, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info });
|
||||
icon.BalloonTipClicked += OnIconOnBalloonTipClicked;
|
||||
icon.BalloonTipClosed += OnIconOnBalloonTipClosed;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"ShowBalloonTip method not found: {title} - {content}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Fallback: If reflection fails, log and continue without showing notification
|
||||
System.Diagnostics.Debug.WriteLine($"ShowBalloonTip failed: {title} - {content}. Error: {ex.Message}");
|
||||
}
|
||||
|
||||
void OnIconOnBalloonTipClicked(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user