
CListViewCtrl and DragAndDrop
hi!
i am using a CListViewCtrl in an active-x within IE. i can drop things into
this control, all works well.
BUT: i cannot drag items within the listcontrol and of course also not
outside the listcontrol. the LVN_BEGINDRAG window message is never throws.
is this the wrong window message, do i have to catch a different one? is
drag and drop possible within and out the CListViewCtrl? dropping works,
also the context menu.
here some of my relevant code:
class ATL_NO_VTABLE CSputnikListControl :
[..]
{
public:
CContainedWindowT<ATLControls::CListViewCtrl> m_ctlSysListView32;
CSputnikDropTarget* m_sputnikDropTarget;
CSputnikListControl() {
m_ctlSysListView32 =
CContainedWindowT<ATLControls::CListViewCtrl>(_T("SysListView32"), this, 1);
m_bWindowOnly = TRUE;
}
BEGIN_MSG_MAP(CSputnikListControl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
MESSAGE_HANDLER(LVN_BEGINDRAG, OnBeginDrag)
MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu)
END_MSG_MAP()
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL&
/*bHandled*/)
{
[..]
InitCommonControls();
[..]
m_ctlSysListView32.Create(m_hWnd, rc);
/*__________________DROP-SUPPORT__________________*/
m_sputnikDropTarget = new CSputnikDropTarget(m_hWnd);
RegisterDragDrop(m_hWnd,m_sputnikDropTarget);
[..]
/*DROP-SUPPORT*/
return 0;
}
LRESULT OnContextMenu(UINT idCtrl/*uMsg*/, WPARAM wparam/*wParam*/, LPARAM
lparam/*lParam*/, BOOL& /*bHandled*/)
{
ATLTRACE("ContextMenu\n");
return 0;
}
LRESULT OnBeginDrag(UINT idCtrl/*uMsg*/, WPARAM wparam/*wParam*/, LPARAM
lparam/*lParam*/, BOOL& /*bHandled*/)
{
ATLTRACE("Something dragged out of my window...\n");
return 0;
}
thx for your help.
yours
Thomas Hofer
see also code at( http://www.*-*-*.com/ )