mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Update environment variables changed (#12689)
This commit is contained in:
committed by
GitHub
parent
31a5d49246
commit
e87e06bae6
@@ -9,6 +9,7 @@ using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using interop;
|
||||
using Microsoft.PowerLauncher.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
@@ -29,8 +30,10 @@ namespace PowerLauncher
|
||||
private readonly MainViewModel _viewModel;
|
||||
private bool _isTextSetProgrammatically;
|
||||
private bool _deletePressed;
|
||||
private HwndSource _hwndSource;
|
||||
private Timer _firstDeleteTimer = new Timer();
|
||||
private bool _coldStateHotkeyPressed;
|
||||
private bool _disposedValue;
|
||||
|
||||
public MainWindow(PowerToysRunSettings settings, MainViewModel mainVM)
|
||||
: this()
|
||||
@@ -93,6 +96,12 @@ namespace PowerLauncher
|
||||
Activate();
|
||||
}
|
||||
|
||||
private void OnSourceInitialized(object sender, EventArgs e)
|
||||
{
|
||||
_hwndSource = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
|
||||
_hwndSource.AddHook(EnvironmentHelper.ProcessWindowMessages);
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowsInteropHelper.DisableControlBox(this);
|
||||
@@ -359,8 +368,6 @@ namespace PowerLauncher
|
||||
}
|
||||
}
|
||||
|
||||
private bool disposedValue;
|
||||
|
||||
private void QueryTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
var textBox = (TextBox)sender;
|
||||
@@ -451,7 +458,7 @@ namespace PowerLauncher
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!disposedValue)
|
||||
if (!_disposedValue)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
@@ -459,12 +466,14 @@ namespace PowerLauncher
|
||||
{
|
||||
_firstDeleteTimer.Dispose();
|
||||
}
|
||||
|
||||
_hwndSource?.Dispose();
|
||||
}
|
||||
|
||||
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
|
||||
// TODO: set large fields to null
|
||||
_firstDeleteTimer = null;
|
||||
disposedValue = true;
|
||||
_disposedValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user