public ref readonly SHFILEINFO GetSHFileInfo(string strPath, uint dwFileAttributes, SHGFI uFlags) { if (IntPtr.Zero == SHFI.SHGetFileInfo(strPath, dwFileAttributes, out _info, (uint)Marshal.SizeOf <SHFILEINFO>(), uFlags)) { throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error()); } return(ref _info); }
protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { // Освобождаем управляемые ресурсы } // освобождаем неуправляемые объекты if (_info.hIcon != IntPtr.Zero) { SHFI.DestroyIcon(_info.hIcon); _info.hIcon = IntPtr.Zero; } disposed = true; } }