Skip to content

Commit efc2596

Browse files
author
Mirroring
committed
Merge commit '1939cce087da10f6e24d5b571912053b0571bf92'
2 parents 779ecce + 1939cce commit efc2596

File tree

1 file changed

+4
-3
lines changed
  • src/System.Windows.Forms/src/System/Windows/Forms

1 file changed

+4
-3
lines changed

src/System.Windows.Forms/src/System/Windows/Forms/AxHost.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,13 +3370,14 @@ protected override unsafe void WndProc(ref Message m)
33703370

33713371
private unsafe void DetachAndForward(ref Message m)
33723372
{
3373+
HWND handle = GetHandleNoCreate();
33733374
DetachWindow();
3374-
if (IsHandleCreated)
3375+
if (!handle.IsNull)
33753376
{
3376-
void* wndProc = (void*)PInvoke.GetWindowLong(this, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC);
3377+
void* wndProc = (void*)PInvoke.GetWindowLong(handle, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC);
33773378
m.ResultInternal = PInvoke.CallWindowProc(
33783379
(delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, LRESULT>)wndProc,
3379-
HWND,
3380+
handle,
33803381
(uint)m.Msg,
33813382
m.WParamInternal,
33823383
m.LParamInternal);

0 commit comments

Comments
 (0)