Merge pull request #1123 from cuiliang/master

Fix #1122
This commit is contained in:
NaBian authored and GitHub committed 2022-02-23 23:06:58 +08:00
commit f874a38406
2 files changed
+15 -2

No files matched your search

@@ -306,7 +306,7 @@ namespace HandyControl.Tools.Interop
internal static InteropValues.WINDOWPLACEMENT GetWindowPlacement(IntPtr hwnd)
{
InteropValues.WINDOWPLACEMENT wINDOWPLACEMENT = new InteropValues.WINDOWPLACEMENT();
InteropValues.WINDOWPLACEMENT wINDOWPLACEMENT = InteropValues.WINDOWPLACEMENT.Default;
if (GetWindowPlacement(hwnd, wINDOWPLACEMENT))
{
return wINDOWPLACEMENT;
@@ -364,12 +364,25 @@ namespace HandyControl.Tools.Interop
[StructLayout(LayoutKind.Sequential)]
internal struct WINDOWPLACEMENT
{
public int length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
public int length;
public int flags;
public SW showCmd;
public POINT ptMinPosition;
public POINT ptMaxPosition;
public RECT rcNormalPosition;
/// <summary>
/// Gets the default (empty) value.
/// </summary>
public static WINDOWPLACEMENT Default
{
get
{
WINDOWPLACEMENT result = new WINDOWPLACEMENT();
result.length = Marshal.SizeOf(result);
return result;
}
}
}
[StructLayout(LayoutKind.Sequential, Pack = 4)]