15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


WM_DROPFILES not being handled by my CListCtrl

Shaju Mathew -- shajum@hpptc51.rose.hp.com
Tuesday, October 22, 1996

Hello,
	I've an SDI app with 2 splitter views - a CTreeView & a CPageView.
The PageView has a child property sheet and a few pages, one of which has
a child CIconListCtrl - obviously derived from CListCtrl(which should 
accept dropped files  from FileManager);

	I made a call to DragAcceptFiles() in CPageView::OnCreate() and
subsequently overrode CIconListCtrl::OnDropFiles(), but it never gets called.

	I then overrode CPageView::OnDropFiles(), and found that it gets called everytime. 

	I can get a handle to the child ListCtrl and then do a 
iconListCtrl->SendMessage(WM_DROPFILES, (WPARAM)hDropInfo, 0L) to allow the 
CIconListCtrl to handle the message, but...

	Am I missing something? Is there an easier and cleaner way around?	
	Environment: MS Visual C++ 4.2/Windows NT 3.51
ThanX
--
***********************************************************************
                              .---.         .---.
Shaju Mathew                 /" "  \  WWW  /  " "\    Off:(916)785-9018 
Performance Technology  Lab / / ""  \(*|*)/  "" \ \ 
Hewlett-Packard Company    //////   '. V .`   \\\\\\ Home:(916)722-4576
8000, Foothills Blvd      //// / // : """ : \\ \ \\\\
MS 5723, Roseville       // /   /  /`.""" '\  \   \ \\Fax:(916)785-1264
CA 95747-5723           //          //.".\\          \\
                     ------------- -UU---UU---------------
Shaju_Mathew@hp.com                '//|||\\`
                                     '' ``     
***********************************************************************



David Lowndes -- David.Lowndes@bj.co.uk
Thursday, October 24, 1996

[Mini-digest: 2 responses]

>I made a call to DragAcceptFiles() in CPageView::OnCreate() and
>subsequently overrode CIconListCtrl::OnDropFiles(), but it never gets called.
>
>I then overrode CPageView::OnDropFiles(), and found that it gets called everytime. 

This is exactly what I'd expect to happen. The WM_DROPFILES message is only
received by a window that called DragAcceptFiles.

The Windows documentation is a bit vague on the details as it talks about an
application (i.e. the main frame window) calling DragAcceptFiles. Its normal
behaviour seems to allow the window that called DragAcceptFiles and all its child
windows to accept the drag/drop operation (the cursor is displayed appropriately by
Windows), but the actual drop message only goes to the window that registered the
capability.

If you only want your CIconListCtrl to accept (& process) the drop operation, it should
be the window that calls DragAcceptFiles.

The way d&d works allows you to differentiate between a drop operation
on a main frame window and a drop onto a child window by having multiple windows
call DragAcceptFiles. For example, in Word if you drop a file onto the frame it loads
the new file. If you drop a file onto a document window, it inserts the file into the
document.

Dave Lowndes
-----From: Stuart Downing 

You want to call DragAcceptFiles() for the CIconListCtrl, not for the CPageView.
I.e. iconListCtrl->DragAcceptFiles().
------
Stuart Downing (formerly of Creative Solutions)
FAME Information Services, Inc.
sdowning@fame.com





| Вернуться в корень Архива |