Skip to content

Commit 8e5836f

Browse files
author
Mirroring
committed
Merge commit 'd5921485825af547a2f0e042773eab05048465fd'
2 parents 63cc41d + d592148 commit 8e5836f

File tree

1 file changed

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

1 file changed

+4
-3
lines changed

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

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

32353235
private unsafe void DetachAndForward(ref Message m)
32363236
{
3237+
HWND handle = GetHandleNoCreate();
32373238
DetachWindow();
3238-
if (IsHandleCreated)
3239+
if (!handle.IsNull)
32393240
{
3240-
void* wndProc = (void*)PInvoke.GetWindowLong(this, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC);
3241+
void* wndProc = (void*)PInvoke.GetWindowLong(handle, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC);
32413242
m.ResultInternal = PInvoke.CallWindowProc(
32423243
(delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, LRESULT>)wndProc,
3243-
HWND,
3244+
handle,
32443245
(uint)m.Msg,
32453246
m.WParamInternal,
32463247
m.LParamInternal);

0 commit comments

Comments
 (0)