mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Check for GetWindowPlacement success (#26122)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user