Beispiel #1
0
        public static string Save(OpenFileSettings settings)
        {
            try
            {
                OpenFileName ofn = new OpenFileName(OpenFileNameCreateType.Base)
                {
                    filter     = settings.filter,
                    initialDir = settings.initialDir,
                    title      = settings.title,
                    flags      = 0x00080000 | 0x00001000 | 0x00000800 | 0x00000200 | 0x00000008
                };
                if (!string.IsNullOrEmpty(settings.defExt))
                {
                    ofn.defExt = settings.defExt;
                }

                //OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST| OFN_ALLOWMULTISELECT|OFN_NOCHANGEDIR
                if (DllTest.GetSaveFileName(ofn))
                {
                    return(ofn.file);
                }
            }catch (Exception ex) { Debug.Log(ex.ToString()); }

            return("");
        }
Beispiel #2
0
 public static extern bool GetSaveFileName([In, Out] OpenFileName ofn);
Beispiel #3
0
 public static bool GetOpenFileName1([In, Out] OpenFileName ofn)
 {
     return(GetOpenFileName(ofn));
 }