Desktop Functions: Smart Device Functions:
|
SHLoadIndirectString (shlwapi)
C# Signature:
[DllImport("shlwapi.dll", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false, ThrowOnUnmappableChar = true)] VB.NET Signature:
Public Declare Auto Function SHLoadIndirectString Lib "shlwapi.dll" (ByVal pszSource As String, ByVal pszOutBuf As String, ByVal cchOutBuf As UInteger, ByVal ppvReserved As IntPtr) As UInteger User-Defined Types:None. Alternative Managed API:Do you know one? Please contribute it! Notes:None. Tips & Tricks:Call Environment.ExpandEnvironmentVariables(path) first if you have a string that contains environment variables. Use Environment.ExpandEnvironmentVariables(path) Sample Code:string resourcePath = resourcePath = Environment.ExpandEnvironmentVariables(resourcePath); StringBuilder outBuff = new StringBuilder(); int result = SHLoadIndirectString(resourcePath, outBuff, -1, IntPtr.Zero); //SHLoadIndirectString returns S_OK (0) if successful if(result == 0)
Console.WriteLine(outBuff.ToString()); Sample Code2:string sWin8ManifestString = StringBuilder outBuff = new StringBuilder(1024); int result = SHLoadIndirectString(sWin8ManifestString, outBuff, outBuff.Capacity, IntPtr.Zero); //SHLoadIndirectString returns S_OK (0) if successfull if(result == 0)
Console.WriteLine(outBuff.ToString()); Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|