Skip to content

Commit

Permalink
Merge branch 'hotfix/UnlimitedStack#22'
Browse files Browse the repository at this point in the history
  • Loading branch information
Smigy22 committed Feb 28, 2023
2 parents 8e0d30b + def699d commit 2780cf6
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions HideVolumeOSD/HideVolumeOSDLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private struct RECT

IntPtr hWndInject = IntPtr.Zero;

VolumePoup volumePopup = new VolumePoup();
VolumePoup volumePopup;

System.Windows.Forms.Timer hideTimer = new System.Windows.Forms.Timer();

Expand Down Expand Up @@ -110,10 +110,12 @@ public void Init()
return;
}

Application.ApplicationExit += Application_ApplicationExit;

if (notifyIcon != null)
{
volumePopup = new VolumePoup();

Application.ApplicationExit += Application_ApplicationExit;

if (Settings.Default.HideOSD)
HideOSD();
else
Expand All @@ -134,14 +136,14 @@ public void Init()
};

notifyIconIdentifier.cbSize = (uint)Marshal.SizeOf(notifyIconIdentifier);
}

KeyHook.VolumeKeyPressed += KeyHook_VolumeKeyPressed;
KeyHook.VolumeKeyReleased += KeyHook_VolumeKeyReleased;
KeyHook.VolumeKeyPressed += KeyHook_VolumeKeyPressed;
KeyHook.VolumeKeyReleased += KeyHook_VolumeKeyReleased;

KeyHook.StartListening();
KeyHook.StartListening();

hideTimer.Tick += HideTimer_Tick;
hideTimer.Tick += HideTimer_Tick;
}
}

private IntPtr FindOSDWindow(bool bSilent)
Expand Down Expand Up @@ -297,12 +299,15 @@ public void ShowOSD()

ShowWindow(hWndInject, 9); // SW_RESTORE

// show window on the screen

internalShowOSD();

if (notifyIcon != null)
{
// show window on the screen

internalShowOSD();

notifyIcon.Icon = Resources.Icon;
}
}

public void ShowMessage(String message, ToolTipIcon icon)
Expand Down

0 comments on commit 2780cf6

Please sign in to comment.