2020-07-07 07:15:45 +12:00
|
|
|
|
// <copyright file="StrRetToBuf.cs" company="PlaceholderCompany">
|
|
|
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
|
|
|
// </copyright>
|
2020-03-28 08:43:16 +13:00
|
|
|
|
|
2020-03-30 06:26:45 +13:00
|
|
|
|
namespace SystemTrayMenu.DllImports
|
2020-03-28 08:43:16 +13:00
|
|
|
|
{
|
2020-07-07 07:15:45 +12:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// wraps the methodcalls to native windows dll's.
|
|
|
|
|
/// </summary>
|
2020-03-28 08:43:16 +13:00
|
|
|
|
public static partial class NativeMethods
|
|
|
|
|
{
|
|
|
|
|
public static int ShlwapiStrRetToBuf(IntPtr pstr, IntPtr pidl, StringBuilder pszBuf, int cchBuf)
|
|
|
|
|
{
|
|
|
|
|
return StrRetToBuf(pstr, pidl, pszBuf, cchBuf);
|
|
|
|
|
}
|
2020-07-08 03:05:19 +12:00
|
|
|
|
|
|
|
|
|
// Takes a STRRET structure returned by IShellFolder::GetDisplayNameOf, converts it to a string, and places the result in a buffer.
|
|
|
|
|
[DllImport("shlwapi.dll", EntryPoint = "StrRetToBuf", ExactSpelling = false, CharSet = CharSet.Unicode, SetLastError = true)]
|
|
|
|
|
private static extern int StrRetToBuf(IntPtr pstr, IntPtr pidl, StringBuilder pszBuf, int cchBuf);
|
2020-03-28 08:43:16 +13:00
|
|
|
|
}
|
|
|
|
|
}
|