public static extern bool EnumResourceLanguagesEx(IntPtr hModule, IntPtr type, IntPtr name, EnumResLangProc callback, IntPtr userParam, MuiResourceFlags flags, ushort langId);
public unsafe void Enumerate_Resource_Languages() { using (var imageRes = LoadLibrary("shell32.dll")) { Assert.False(imageRes.IsInvalid); // Get bitmap resource IDs. List <int> intResources = new List <int>(); EnumResNameProc onResourceFound = (module, type, name, lparam) => { if (IS_INTRESOURCE(name)) { intResources.Add((int)name); } return(true); }; Assert.True(EnumResourceNames(imageRes, RT_BITMAP, onResourceFound, IntPtr.Zero)); Assert.NotEmpty(intResources); // Get resource languages for bitmap resources. List <LANGID> resourceLanguages = new List <LANGID>(); EnumResLangProc onResourceLanguageFound = (module, type, name, language, lParam) => { if (IS_INTRESOURCE(name)) { resourceLanguages.Add(language); } return(true); }; Assert.True(EnumResourceLanguages(imageRes, RT_BITMAP, MAKEINTRESOURCE(intResources.First()), onResourceLanguageFound, (void *)IntPtr.Zero), GetLastError().ToString()); Assert.NotEmpty(resourceLanguages); } }
public static extern Boolean EnumResourceLanguages(IntPtr moduleHandle, IntPtr type, IntPtr name, EnumResLangProc callback, IntPtr userParam);
public static extern bool EnumResourceLanguages(IntPtr hModule, IntPtr lpType, IntPtr lpName, EnumResLangProc lpEnumFunc, IntPtr lParam);
/// Enumerates language-specific resources, of the specified type and name, associated with a binary module. [DllImport(kernl32, SetLastError = true), ] static public extern bool EnumResourceLanguages(IntPtr hModule, string lpszType, string lpName, EnumResLangProc lpEnumFunc, IntPtr lParam);
private static extern bool EnumResourceLanguages(IntPtr hModule, IntPtr type, IntPtr name, EnumResLangProc lpEnumFunc, IntPtr lp);
private static extern bool EnumResourceLanguages(IntPtr hModule, IntPtr lpType, [MarshalAs(UnmanagedType.LPTStr)] string lpName, EnumResLangProc lpEnumFunc, IntPtr lParam);