コード例 #1
0
        /// <summary>
        /// Returns list of files & folders that are currently selected by the mouse
        /// </summary>
        /// <returns></returns>
        protected List <string> GetSelectedFiles()
        {
            List <string> list = new List <string>();

            if (mDropHandle != IntPtr.Zero)
            {
                uint nselected = DllImports.DragQueryFile(mDropHandle, 0xFFFFFFFF, null, 0);
                for (uint i = 0; i < nselected; ++i)
                {
                    if (DllImports.DragQueryFile(mDropHandle, i, mStringBuilder, ( uint )mStringBuilder.Capacity) > 0)
                    {
                        list.Add(mStringBuilder.ToString().Trim());
                    }
                }
            }

            return(list);
        }