CListViewCtrl and DragAndDrop 
Author Message
 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/ )



Tue, 26 Apr 2005 18:40:13 GMT  
 CListViewCtrl and DragAndDrop
You handle LVN_BEGINDRAG incorrectly. It comes in the form of WM_NOTIFY
message. See NOTIFY_HANDLER
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> 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.



Wed, 27 Apr 2005 02:21:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. RichEditView (DragAndDrop)

2. WTL CListViewCtrl

3. Change Image in CListViewCtrl

4. Superclassing CListViewCtrl (ATL)

5. Flicker during resize in CListViewCtrl

6. OnPaint override on CListViewCtrl?

7. WTL & CListViewCtrl

8. Deleting Selected items in CListViewCtrl

9. CListViewCtrl

10. How to get FullRowSelect to select whole row in CListViewCtrl

11. Wrapping column headers in CListViewCtrls

12. CListViewCtrl stupid question

 

 
Powered by phpBB® Forum Software