Why does GetSafeHwnd () return zero in an ActiveX control?

I developed an MFC Activex control that has no windows and is invisible at runtime, whereas I assumed that activex is basically a control that will manipulate the Windows handle, I used GetSafeHwnd() to get the Windows handle, but unfortunately , this method returns zero at startup. I may have set the wrong option when creating my activex. how can i create an acless activex that could manipulate hanlde windows?

-1
source share
1 answer

By definition, a windowless ActiveX control does not have a window and is displayed as part of its parent. If you want to work with Windows messages in a control, you can create a workflow with a message outline and process any messages there. To have a message loop, you don't need a window, just a stream. This solution can be implemented in windowless control or in any COM component.

Alternatively, you can use the ActiveX window control by changing its properties.

+2
source

Source: https://habr.com/ru/post/1442269/


All Articles