Skip to content

Commit

Permalink
Minor refactorings.
Browse files Browse the repository at this point in the history
  • Loading branch information
MKKNinetyTwo authored Nov 15, 2024
1 parent fc3ccd5 commit e5363b2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions RetroBar/Utilities/ExplorerMonitor.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
using ManagedShell.Common.Logging;
using ManagedShell.Interop;
using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace RetroBar.Utilities
{
public class ExplorerMonitor : IDisposable
{
private bool _explorerMonitorisMonitoring;
private ExplorerMonitorWindow _explorerMonitorWindow;

public void ExplorerMonitorStart(WindowManager windowManagerRef)
{
if (_explorerMonitorisMonitoring) { return; } // Prevent multiple monitors.
if (_explorerMonitorWindow != null) { return; } // Prevent multiple monitors.

_explorerMonitorisMonitoring = true;
_explorerMonitorWindow = new ExplorerMonitorWindow(windowManagerRef); // Start monitoring.
}

Expand All @@ -28,9 +26,9 @@ private class ExplorerMonitorWindow : NativeWindow, IDisposable
private readonly WindowManager _windowManagerRef;
private static readonly int WM_TASKBARCREATEDMESSAGE = NativeMethods.RegisterWindowMessage("TaskbarCreated");

public ExplorerMonitorWindow(WindowManager windowManager)
public ExplorerMonitorWindow(WindowManager windowManagerRef)
{
_windowManagerRef = windowManager;
_windowManagerRef = windowManagerRef;
CreateHandle(new CreateParams());
}

Expand All @@ -44,7 +42,7 @@ protected override void WndProc(ref Message m)
}
catch (Exception ex)
{
Debug.WriteLine($"Error handling TaskbarCreated message on ExplorerMonitor: {ex.Message}");
ShellLogger.Warning($"Error handling TaskbarCreated message on ExplorerMonitor: {ex.Message}");
}
}

Expand Down

0 comments on commit e5363b2

Please sign in to comment.