mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PreviewHandlers]Check for Disposed state when updating window bounds (#33373)
* Fixed Previewer production crash with an ObjectDisposedException * Bumped MSBuildCacheCacheUniverse
This commit is contained in:
@@ -120,6 +120,12 @@ namespace Common
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateWindowBounds(IntPtr hwnd, Rectangle newBounds)
|
public void UpdateWindowBounds(IntPtr hwnd, Rectangle newBounds)
|
||||||
{
|
{
|
||||||
|
if (this.Disposing || this.IsDisposed)
|
||||||
|
{
|
||||||
|
// For unclear reasons, this can be called when handling an error and the form has already been disposed.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We must set the WS_CHILD style to change the form to a control within the Explorer preview pane
|
// We must set the WS_CHILD style to change the form to a control within the Explorer preview pane
|
||||||
int windowStyle = NativeMethods.GetWindowLong(Handle, gwlStyle);
|
int windowStyle = NativeMethods.GetWindowLong(Handle, gwlStyle);
|
||||||
if ((windowStyle & wsChild) == 0)
|
if ((windowStyle & wsChild) == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user