Search code examples
c++visual-c++mfcmshtmlafx

Embedded IE control (CHtmlView) not passing down WM_SIZE while dragging


I've noticed that with an embedded IE Control (CHtmlView), any attempts to resize by dragging the parent window's border do not resize the inner workings of the IE control. I fired up Spy++ and compared the embedded control vs an IE browser, and I'm pretty sure it's the "Shell Embedding" window preventing any sizing events to propagating down to the Internet Explorer_Server control.

enter image description here

I can see WM_SIZE, WM_WINDOWPOSCHANGED, etc. hitting the Shell Embedding control, but the Shell DocObject View gets nothing. It will, however, receive those messages via Maximizing / Restore Down and resize the inner IE_Server appropriately.

Looking at IE itself:

enter image description here

I do see sizing, position change, etc. events hitting the Shell DocObject View, and obviously IE resizes the page while dragging the border. The only thing that would make sense is that Shell Embedding window isn't letting resizing go through via dragging to resize.

Is this accurate, and if so, is there a workaround to getting this to resize aside from some hack of sending WM_SIZE events manually to the Shell Embedding child to force it to resize?


Solution

  • We ended up falling victim to the Windows stack size limitation when the number of child MFC windows exceeds the maximum stack size, and messages no longer get sent all the way down.

    A hack of sending a PostMessage to resize a few levels up back into the message pump resolves this.