CEF and dragging a titleless window using WINAPI

I am developing a C ++ application displaying an MFC window without a title (top window pane), with a CEF control inside it. I would like the user to be able to click any area of ​​the window and drag it as if the tab were dragged.

The usual solution seems to simulate a click of the header, either by publishing WM_NCLBUTTONDOWN using wparam HTCAPTION, or by intercepting WM_NCHITTEST and returning HTCAPTION. I tested both solutions - they work fine while I click on the non-CEF area of ​​the window. A click on the CEF area is detected in my MFC code, but I cannot drag the window.

I have a suspicion that the CEF (or chrome inside it) intercepts some of my NC * messages; or publish your own versions. However, I do not know how to debug it or prevent it.

Does anyone have any suggestions on how to fix this or any alternative solutions?

+4
source share

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


All Articles