Skip to content

Commit 5d9bd8e

Browse files
Sachin-NIEpica3055
authored andcommitted
Resolved issue in sending WM_DESTROY msg to ActiveX controls (#12564)
1 parent 2dc2247 commit 5d9bd8e

File tree

1 file changed

+2
-1
lines changed
  • src/System.Windows.Forms/src/System/Windows/Forms

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3370,8 +3370,9 @@ protected override unsafe void WndProc(ref Message m)
33703370

33713371
private unsafe void DetachAndForward(ref Message m)
33723372
{
3373+
bool isHandleCreated = IsHandleCreated;
33733374
DetachWindow();
3374-
if (IsHandleCreated)
3375+
if (isHandleCreated)
33753376
{
33763377
void* wndProc = (void*)PInvoke.GetWindowLong(this, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC);
33773378
m.ResultInternal = PInvoke.CallWindowProc(

0 commit comments

Comments
 (0)