MFC Grid manual

NM_GRIDDRAGDROP Struct Reference

Sent by the grid to notify its parent window about drag & drop processing. This notification is sent in form of WM_NOTIFY message. More...

#include <Dapfor/GUI/Notifications.h>

List of all members.


Public Attributes

NMHDR hdr
 NMHDR structure that contains information about this notification message.
Notifications::NotificationType type
 Notification type.
CGridgrid
 The grid that sends this notification.
CDragSourcedragSource
 Source of a content.
CDropTargetdropTarget
 Location where a clipboard content is to be dropped.
DROPEFFECT effect
 Drop effect. One of the next values: DROPEFFECT_COPY, DROPEFFECT_MOVE, DROPEFFECT_LINK, DROPEFFECT_NONE.

Detailed Description

Sent by the grid to notify its parent window about drag & drop processing. This notification is sent in form of WM_NOTIFY message.

Related events identifiers:

GUI::Notifications::BeginDrag
GUI::Notifications::EndDrag
GUI::Notifications::BeginDrop
GUI::Notifications::EndDrop

GUI::NM_GRIDDRAGDROP* lpNotif = (GUI::NM_GRIDDRAGDROP*) lParam;

 Example:

 //File TestDlg.h

 class CTestDlg : public CDialog
 {
   ...

 protected:
     afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);

 private:
     GUI::CGrid m_Grid;

     DECLARE_MESSAGE_MAP()
 };


 //File TestDlg.cpp

 BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
     ...
     ON_NOTIFY(GUI::Notifications::BeginDrag, IDC_GRID, OnBeginDrag)
     ...
 END_MESSAGE_MAP()


 void CTestDlg::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult)
 {
     GUI::NM_GRIDDRAGDROP* pItem = (GUI::NM_GRIDDRAGDROP*)pNMHDR;
     
     //To do something...
 
     *pResult = 0;
 }