我试图在我的WPF应用程序中使用Accent Color,我发现GitHub中的一个类始终是相同的。
static class UxTheme
{
[DllImport("uxtheme.dll", EntryPoint = "#98", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
public static extern uint GetImmersiveUserColorSetPreference(bool forceCheckRegistry, bool skipCheckOnFail);
[DllImport("uxtheme.dll", EntryPoint = "#94", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
public static extern uint GetImmersiveColorSetCount();
[DllImport("uxtheme.dll", EntryPoint = "#95", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
public static extern uint GetImmersiveColorFromColorSetEx(uint immersiveColorSet, uint immersiveColorType,
bool ignoreHighContrast, uint highContrastCacheMode);
[DllImport("uxtheme.dll", EntryPoint = "#96", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
public static extern uint GetImmersiveColorTypeFromName(IntPtr name);
[DllImport("uxtheme.dll", EntryPoint = "#100", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
public static extern IntPtr GetImmersiveColorNamedTypeByIndex(uint index);
}
我在SDK和MSDN中找到了uxtheme文档,但这种方法不是。
我dumpbin uxtheme.dll并惊喜!它们是未命名的功能。 (#95&#98除外)。
如何获得uxtheme(或其他)库的签名?然后,我可以尝试错误猜测我需要的功能。