Skip to content

Commit a879ebc

Browse files
committed
fixed #886
1 parent 4db1c8a commit a879ebc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Shared/HandyControl_Shared/Controls/Window/Window.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ private IntPtr HwndSourceHook(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam
169169
WmGetMinMaxInfo(hwnd, lparam);
170170
Padding = WindowState == WindowState.Maximized ? WindowHelper.WindowMaximizedPadding : _commonPadding;
171171
break;
172+
case InteropValues.WM_NCHITTEST:
173+
// for fixing #886
174+
// https://developercommunity.visualstudio.com/t/overflow-exception-in-windowchrome/167357
175+
try
176+
{
177+
_ = lparam.ToInt32();
178+
}
179+
catch (OverflowException)
180+
{
181+
handled = true;
182+
}
183+
break;
172184
}
173185

174186
return IntPtr.Zero;

src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ internal const int
5656
WM_SETICON = 0x0080,
5757
WM_NCCREATE = 0x0081,
5858
WM_NCDESTROY = 0x0082,
59+
WM_NCHITTEST = 0x0084,
5960
WM_NCACTIVATE = 0x0086,
6061
WM_NCRBUTTONDOWN = 0x00A4,
6162
WM_NCRBUTTONUP = 0x00A5,

0 commit comments

Comments
 (0)