Skip to content

Commit

Permalink
how'd you get lost
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Feb 5, 2025
1 parent fa87315 commit 607410e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/modules/cmdpal/Microsoft.CmdPal.UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public sealed partial class MainWindow : Window,
#pragma warning restore SA1310 // Field names should not contain underscore

// Notification Area ("Tray") icon data
private NOTIFYICONDATAW? _trayIIconData;
private NOTIFYICONDATAW? _trayIconData;
private bool _createdIcon;
private DestroyIconSafeHandle? _largeIcon;

Expand Down Expand Up @@ -396,14 +396,14 @@ private LRESULT HotKeyPrc(
private void AddNotificationIcon()
{
// We only need to build the tray data once.
if (_trayIIconData == null)
if (_trayIconData == null)
{
// We need to stash this handle, so it doesn't clean itself up. If
// explorer restarts, we'll come back through here, and we don't
// really need to re-load the icon in that case. We can just use
// the handle from the first time.
_largeIcon = GetAppIconHandle();
_trayIIconData = new NOTIFYICONDATAW()
_trayIconData = new NOTIFYICONDATAW()
{
cbSize = (uint)Marshal.SizeOf(typeof(NOTIFYICONDATAW)),
hWnd = _hwnd,
Expand All @@ -415,7 +415,7 @@ private void AddNotificationIcon()
};
}

var d = (NOTIFYICONDATAW)_trayIIconData;
var d = (NOTIFYICONDATAW)_trayIconData;

// Add the notification icon
if (PInvoke.Shell_NotifyIcon(NOTIFY_ICON_MESSAGE.NIM_ADD, in d))
Expand All @@ -426,9 +426,9 @@ private void AddNotificationIcon()

private void RemoveNotificationIcon()
{
if (_trayIIconData != null && _createdIcon)
if (_trayIconData != null && _createdIcon)
{
var d = (NOTIFYICONDATAW)_trayIIconData;
var d = (NOTIFYICONDATAW)_trayIconData;
if (PInvoke.Shell_NotifyIcon(NOTIFY_ICON_MESSAGE.NIM_DELETE, in d))
{
_createdIcon = false;
Expand Down

0 comments on commit 607410e

Please sign in to comment.