Drag and drop of files in ATL
-
Hi, I was developing an ActiveX control that is to be embedded in IE. While trying to implement, I ran into this problem: I thought capturing the WM_DROPFILES message should be sufficient for providing drag and drop support of files (from file explorer) to the ActiveX control. While this works if the control is embedded in a thick client (say a VB form), it doesn't work when the control is embedded inside IE. IE's default handling of dropped files kicks in and it tries to open the file! I tried to look for help from the usual sources (MSDN, google etc) but most of them deal with MFC drag and drop support while I am using ATL and can't use any of those. Any help here would be greatly appreciated! Thanks, KR Nathan
-
Hi, I was developing an ActiveX control that is to be embedded in IE. While trying to implement, I ran into this problem: I thought capturing the WM_DROPFILES message should be sufficient for providing drag and drop support of files (from file explorer) to the ActiveX control. While this works if the control is embedded in a thick client (say a VB form), it doesn't work when the control is embedded inside IE. IE's default handling of dropped files kicks in and it tries to open the file! I tried to look for help from the usual sources (MSDN, google etc) but most of them deal with MFC drag and drop support while I am using ATL and can't use any of those. Any help here would be greatly appreciated! Thanks, KR Nathan
-
Hi To have drop capabilities, a control must implement IDropTarget interface and regiter itself as a drop target using the RegisterDragDrop function. Fabian
Thanks for this info. However, looking at the IDropTarget, it looks like much more sophisticated than what I require. When files are dragged from explorer and dropped, I just need to know the filenames of the dropped files so that I can show them in a list inside my control. WM_DROPFILES does exactly same but doesn't seem to be working when the control is placed inside IE. Thanks for your help.