Compare commits

...

5 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
0bf21be62a Use reflection to call ShowBalloonTip to avoid JIT compilation errors
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
2025-10-23 17:16:48 +00:00
copilot-swe-agent[bot]
35dc57006e Add try-catch wrapper around ShowBalloonTip to prevent crash on startup
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
2025-10-23 17:08:45 +00:00
copilot-swe-agent[bot]
d397e15a2c Initial plan 2025-10-23 16:55:41 +00:00
copilot-swe-agent[bot]
4bff62f4d8 Fix Desktop file selection by using consistent IsCursorActivated check
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled
Co-authored-by: emako <24737061+emako@users.noreply.github.com>
2025-10-22 01:45:23 +08:00
ema
e0eb87bcc3 Add .slnx solution file
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled
2025-10-20 01:11:47 +08:00
3 changed files with 97 additions and 4 deletions

View File

@@ -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;

71
QuickLook.slnx Normal file
View File

@@ -0,0 +1,71 @@
<Solution>
<Configurations>
<Platform Name="Any CPU" />
<Platform Name="x64" />
</Configurations>
<Folder Name="/QuickLook.Native/">
<Project Path="QuickLook.Native/QuickLook.Native32/QuickLook.Native32.vcxproj" Id="d31ee321-c2b0-4984-b749-736f7de509f1">
<Platform Project="Win32" />
</Project>
<Project Path="QuickLook.Native/QuickLook.Native64/QuickLook.Native64.vcxproj" Id="794e4dcf-f715-4836-9d30-abd296586d23" />
</Folder>
<Folder Name="/QuickLook.Plugin/">
<Project Path="QuickLook.Plugin/QuickLook.Plugin.AppViewer/QuickLook.Plugin.AppViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/QuickLook.Plugin.ArchiveViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.CLSIDViewer/QuickLook.Plugin.CLSIDViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.CsvViewer/QuickLook.Plugin.CsvViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.ELFViewer/QuickLook.Plugin.ELFViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.FontViewer/QuickLook.Plugin.FontViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.HelixViewer/QuickLook.Plugin.HelixViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/QuickLook.Plugin.HtmlViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.MailViewer/QuickLook.Plugin.MailViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.MarkdownViewer/QuickLook.Plugin.MarkdownViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.MediaInfoViewer/QuickLook.Plugin.MediaInfoViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.OfficeViewer/QuickLook.Plugin.OfficeViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.PDFViewer/QuickLook.Plugin.PdfViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.PEViewer/QuickLook.Plugin.PEViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/QuickLook.Plugin.PluginInstaller.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.TextViewer/QuickLook.Plugin.TextViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.ThumbnailViewer/QuickLook.Plugin.ThumbnailViewer.csproj" />
<Project Path="QuickLook.Plugin/QuickLook.Plugin.VideoViewer/QuickLook.Plugin.VideoViewer.csproj" />
</Folder>
<Folder Name="/Solution Items/">
<File Path="GitVersion.cs" />
</Folder>
<Project Path="QuickLook.Common/QuickLook.Common.csproj">
<Platform Solution="*|x64" Project="x64" />
</Project>
<Project Path="QuickLook.Installer/QuickLook.Installer.wixproj" Id="f0214fc2-efbe-426c-842d-b42bc37d9525">
<BuildDependency Project="QuickLook.Common/QuickLook.Common.csproj" />
<BuildDependency Project="QuickLook.Native/QuickLook.Native32/QuickLook.Native32.vcxproj" />
<BuildDependency Project="QuickLook.Native/QuickLook.Native64/QuickLook.Native64.vcxproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.AppViewer/QuickLook.Plugin.AppViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.ArchiveViewer/QuickLook.Plugin.ArchiveViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.CLSIDViewer/QuickLook.Plugin.CLSIDViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.CsvViewer/QuickLook.Plugin.CsvViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.ELFViewer/QuickLook.Plugin.ELFViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.FontViewer/QuickLook.Plugin.FontViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.HelixViewer/QuickLook.Plugin.HelixViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.HtmlViewer/QuickLook.Plugin.HtmlViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.MailViewer/QuickLook.Plugin.MailViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.MarkdownViewer/QuickLook.Plugin.MarkdownViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.MediaInfoViewer/QuickLook.Plugin.MediaInfoViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.OfficeViewer/QuickLook.Plugin.OfficeViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.PDFViewer/QuickLook.Plugin.PdfViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.PEViewer/QuickLook.Plugin.PEViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.PluginInstaller/QuickLook.Plugin.PluginInstaller.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.TextViewer/QuickLook.Plugin.TextViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.ThumbnailViewer/QuickLook.Plugin.ThumbnailViewer.csproj" />
<BuildDependency Project="QuickLook.Plugin/QuickLook.Plugin.VideoViewer/QuickLook.Plugin.VideoViewer.csproj" />
<BuildDependency Project="QuickLook/QuickLook.csproj" />
<Platform Project="x86" />
<Build />
</Project>
<Project Path="QuickLook/QuickLook.csproj">
<BuildDependency Project="QuickLook.Native/QuickLook.Native32/QuickLook.Native32.vcxproj" />
<BuildDependency Project="QuickLook.Native/QuickLook.Native64/QuickLook.Native64.vcxproj" />
<Platform Solution="*|x64" Project="x64" />
</Project>
</Solution>

View File

@@ -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)
{