Example #1
0
        /// <summary>
        /// Gets the file list.
        /// </summary>
        /// <param name="xd4b53aa4023f2377">The xd4b53aa4023f2377.</param>
        /// <returns></returns>
        internal static string[] GetFileList(IOleDataObject xd4b53aa4023f2377)
        {
            string[]  strArray   = null;
            FORMATETC pformatetc = new FORMATETC();
            STGMEDIUM pmedium    = new STGMEDIUM();

            pformatetc.cfFormat = 15;
            pformatetc.tymed    = TYMED.TYMED_HGLOBAL;
            pformatetc.dwAspect = DVASPECT.DVASPECT_CONTENT;
            if (xd4b53aa4023f2377.GetData(ref pformatetc, ref pmedium) != 0)
            {
                return(null);
            }
            int           num      = DragQueryFile(pmedium.unionmember, -1, null, 0);
            StringBuilder lpszFile = new StringBuilder(260);

            if (num > 0)
            {
                strArray = new string[num];
                for (int i = 0; i < num; i++)
                {
                    DragQueryFile(pmedium.unionmember, i, lpszFile, lpszFile.Capacity);
                    strArray[i] = lpszFile.ToString();
                }
            }
            ReleaseStgMedium(ref pmedium);
            return(strArray);
        }