Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/CodingWithCalvin.VSToolbox/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
_appWindow = AppWindow.GetFromWindowId(windowId);

// Set the window/taskbar icon
var iconPath = Path.Combine(AppContext.BaseDirectory, "Assets", "vs2026_icon.ico");
if (File.Exists(iconPath))
{
_appWindow.SetIcon(iconPath);
}

// Set up the main content
var rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\vs2026_icon.png" />
<Content Include="Assets\vs2026_icon.ico" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>

Expand Down
13 changes: 9 additions & 4 deletions src/CodingWithCalvin.VSToolbox/Services/TrayIconService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,24 @@ public void Initialize(Window window)

private static Icon? GetAppIcon()
{
// Try to get the app's icon from the executable
var exePath = Environment.ProcessPath;
if (!string.IsNullOrEmpty(exePath) && File.Exists(exePath))
// Try to load the VS icon from Assets
var appDir = AppContext.BaseDirectory;
var iconPath = Path.Combine(appDir, "Assets", "vs2026_icon.png");

if (File.Exists(iconPath))
{
try
{
return Icon.ExtractAssociatedIcon(exePath);
using var bitmap = new Bitmap(iconPath);
var hIcon = bitmap.GetHicon();
return Icon.FromHandle(hIcon);
}
catch
{
// Fall back to default
}
}

return SystemIcons.Application;
}

Expand Down