Exemplo n.º 1
0
        public int DragDrop(IntPtr pDataObj, int grfKeyState, Point pt, ref int pdwEffect)
        {
            //Debug.WriteLine("In DragDrop: Effect = " & pdwEffect & " Keystate = " & grfKeyState)
            int res;

            if (m_LastTarget != null)
            {
                res = m_LastTarget.DragDrop(pDataObj, grfKeyState, pt, ref pdwEffect);
                //version 21 change
                if (res != 0 && res != 1)
                {
                    Debug.WriteLine("Error in dropping on DropTarget. res = " + Convert.ToString(res, 16));
                }                 //No error on drop
                // it is quite possible that the actual Drop has not completed.
                // in fact it could be Canceled with nothing happening.
                // All we are going to do is hope for the best
                // The documented norm for Optimized Moves is pdwEffect=None, so leave it
                if (ShDragDropEvent != null)
                {
                    ShDragDropEvent(m_DropList, m_LastNode, grfKeyState, pdwEffect);
                }
            }
            ResetPrevTarget();
            int cnt = Marshal.Release(m_DragDataObj);             //get rid of cnt added in DragEnter

            m_DragDataObj = IntPtr.Zero;
            return(0);
        }