How to change the size of activex control automatically?

617 Views Asked by At

I wrote an activex control for showing images in richedit.What i want is the control's size changes as the image in it changes, but the control's size seems to be fixed, i've no idea how to get it.Is there way to reach that?

1

There are 1 best solutions below

0
On

Change the size of your ActiveX control's window with SetWindowPos then call IOleInPlaceSite::OnPosRectChange on your site object.

[EDITED] Apparently, you could perform the above upon EN_REQUESTRESIZE notification from RichEdit. EN_OBJECTPOSITIONS also looks relevant. Try both and share the result with us.