139: Application crashes on Windows User switch
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using EveOPreview.Services.Interop;
|
using EveOPreview.Services.Interop;
|
||||||
|
|
||||||
namespace EveOPreview.Services.Implementation
|
namespace EveOPreview.Services.Implementation
|
||||||
@@ -45,6 +46,12 @@ namespace EveOPreview.Services.Implementation
|
|||||||
// a thumbnail source
|
// a thumbnail source
|
||||||
this._handle = IntPtr.Zero;
|
this._handle = IntPtr.Zero;
|
||||||
}
|
}
|
||||||
|
catch (COMException)
|
||||||
|
{
|
||||||
|
// This exception is raised if DWM is suddenly not available
|
||||||
|
// (f.e. when switching between Windows user accounts)
|
||||||
|
this._handle = IntPtr.Zero;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unregister()
|
public void Unregister()
|
||||||
@@ -61,6 +68,10 @@ namespace EveOPreview.Services.Implementation
|
|||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
catch (COMException)
|
||||||
|
{
|
||||||
|
// This exception is raised when DWM is not available for some reason
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Move(int left, int top, int right, int bottom)
|
public void Move(int left, int top, int right, int bottom)
|
||||||
@@ -81,7 +92,11 @@ namespace EveOPreview.Services.Implementation
|
|||||||
}
|
}
|
||||||
catch (ArgumentException)
|
catch (ArgumentException)
|
||||||
{
|
{
|
||||||
//This exception will be thrown if the EVE client disappears while this method is running
|
// This exception will be thrown if the EVE client disappears while this method is running
|
||||||
|
}
|
||||||
|
catch (COMException)
|
||||||
|
{
|
||||||
|
// This exception is raised when DWM is not available for some reason
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user