c++ - How can you make an MFC application with an HTML view consistently accept drag-dropped files? -


When I drag files into the client area, I am trying to understand the behavior of CHtmlView, so I created a new MFC The app is created and commented on Chetmeweewel that navigates to MSDN on startup. In my main frame, I have overridden the CWND :: OnDraft file () with a function that shows a message box when WM_DROPFILES is sent.

OnDropFiles () triggers on all except for the first time Try dragging any file into the application Typically, for the first time, requesting to display the data in the file instead of the request to open the file The form is interpreted by the application. I have tried to override the view class from the ondroid (), but it is never called.

Why is it different for the first time? How can I get all the attempts to drag a file into my app?

This is a part of the underlying web browser control behavior by default Set the CHtmlView set register aspraftal to true , which means that the control prevents drop operations and processes its own.

If you want to stop this, call SetRegisterAsDropTarget (FALSE) in your OnInitialUpdate implementation then all drop operations will interact with the main window.


Comments