mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 01:36:31 +02:00
[fxcop] image resizer ui (#6841)
* adjustments * Settings fixed * Getting resizing tests operational again * fixed default vs loading from settings * one small tewak
This commit is contained in:
@@ -24,7 +24,7 @@ namespace ImageResizer
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
var batch = ResizeBatch.FromCommandLine(Console.In, e.Args);
|
||||
var batch = ResizeBatch.FromCommandLine(Console.In, e?.Args);
|
||||
|
||||
// TODO: Add command-line parameters that can be used in lieu of the input page (issue #14)
|
||||
var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default));
|
||||
@@ -34,12 +34,12 @@ namespace ImageResizer
|
||||
BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle);
|
||||
}
|
||||
|
||||
private void BecomeForegroundWindow(IntPtr hWnd)
|
||||
private static void BecomeForegroundWindow(IntPtr hWnd)
|
||||
{
|
||||
Win32Helpers.INPUT input = new Win32Helpers.INPUT { type = Win32Helpers.INPUTTYPE.INPUT_MOUSE, data = { } };
|
||||
Win32Helpers.INPUT[] inputs = new Win32Helpers.INPUT[] { input };
|
||||
Win32Helpers.SendInput(1, inputs, Win32Helpers.INPUT.Size);
|
||||
Win32Helpers.SetForegroundWindow(hWnd);
|
||||
NativeMethods.INPUT input = new NativeMethods.INPUT { type = NativeMethods.INPUTTYPE.INPUT_MOUSE, data = { } };
|
||||
NativeMethods.INPUT[] inputs = new NativeMethods.INPUT[] { input };
|
||||
_ = NativeMethods.SendInput(1, inputs, NativeMethods.INPUT.Size);
|
||||
NativeMethods.SetForegroundWindow(hWnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user