Check for GetWindowPlacement success (#26122)

This commit is contained in:
xtqqczze
2025-10-09 15:41:08 +05:00
committed by GitHub
parent f247d802dd
commit d581baabd4
+6 -1
View File
@@ -985,7 +985,12 @@ public static WINDOWPLACEMENT GetPlacement(IntPtr hwnd)
{
WINDOWPLACEMENT placement = new WINDOWPLACEMENT();
placement.length = Marshal.SizeOf(placement);
GetWindowPlacement(hwnd, ref placement);
if (!GetWindowPlacement(hwnd, ref placement))
{
throw new System.ComponentModel.Win32Exception();
}
return placement;
}