mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-02 02:24:38 +12:00
[BUG] COMException (0x8000FFFF) when exit while folder dialog open (#233), version 1.0.25.6
This commit is contained in:
parent
6d8cf4da39
commit
e4f3d6b67a
|
@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.25.5")]
|
||||
[assembly: AssemblyFileVersion("1.0.25.5")]
|
||||
[assembly: AssemblyVersion("1.0.25.6")]
|
||||
[assembly: AssemblyFileVersion("1.0.25.6")]
|
||||
|
|
|
@ -85,26 +85,33 @@ namespace SystemTrayMenu.UserInterface.FolderBrowseDialog
|
|||
|
||||
if (owner != null && frm.Show(owner.Handle) == NativeMethods.S_OK)
|
||||
{
|
||||
if (frm.GetResult(out NativeMethods.IShellItem shellItem) == NativeMethods.S_OK)
|
||||
try
|
||||
{
|
||||
if (shellItem.GetDisplayName(
|
||||
NativeMethods.SIGDN_FILESYSPATH,
|
||||
out IntPtr pszString) == NativeMethods.S_OK)
|
||||
if (frm.GetResult(out NativeMethods.IShellItem shellItem) == NativeMethods.S_OK)
|
||||
{
|
||||
if (pszString != IntPtr.Zero)
|
||||
if (shellItem.GetDisplayName(
|
||||
NativeMethods.SIGDN_FILESYSPATH,
|
||||
out IntPtr pszString) == NativeMethods.S_OK)
|
||||
{
|
||||
try
|
||||
if (pszString != IntPtr.Zero)
|
||||
{
|
||||
Folder = Marshal.PtrToStringAuto(pszString);
|
||||
return DialogResult.OK;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeCoTaskMem(pszString);
|
||||
try
|
||||
{
|
||||
Folder = Marshal.PtrToStringAuto(pszString);
|
||||
return DialogResult.OK;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeCoTaskMem(pszString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warn("Folder Dialog failed", ex);
|
||||
}
|
||||
}
|
||||
|
||||
return DialogResult.Cancel;
|
||||
|
|
Loading…
Reference in a new issue