简体   繁体   中英

Problem with SetCapture and IWebBrowser2 container

I have an OLE object of IWebBrowser2 wrapped in a window.

At some point I expand the window and its OLE object and I'd like it to collapse on external click (ie every click that is outside the web browser).

I use SetCapture on the window wrapper but from some reason, during the capture, the Webbrowser doesn't receive any mouse events (clicks,move etc...)

Any thoughts\ideas?

Thanks,
Omer

Cite from SetCapture :

Sets the mouse capture to the specified window belonging to the current thread. SetCapture captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down . Only one window at a time can capture the mouse.

So you cannot use SetCapture on a window to actually capture clicks. It specifically for the case where the user clicks your window and moves the mouse out, while keeping the button pressed. So you will have to use another mechanism.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM