0

现在我想从 ini 中的变量中获取值并将它们吐出到 sendkey 函数中。所以目前这就是我在顶部定义它们的方式显然不正确,因为我在测试变量时得到了默认值。

const int KeyAtk = GetPrivateProfileInt(L"BotSettings",L"AttackKey", 0xA2, L"config.ini");
const int KeyLoot = GetPrivateProfileInt(L"BotSettings",L"LootKey", 0x5A, L"config.ini");
//Counts
int CntAtk = GetPrivateProfileInt(L"BotSettings",L"PressAttack", 25, L"config.ini");
int CntLoot = GetPrivateProfileInt(L"BotSettings",L"PressLoot", 15, L"config.ini");

前面带有 const int 的值具有十六进制值,例如 0xA2 和 0x5A,它们只是虚拟键代码。我希望能够随时更改此密钥,这就是为什么我不只是在 sendkey 函数中使用它的任何人都知道如何让 GetPrivateProfileInt 读取十六进制值。

4

1 回答 1

2

GetPrivateProfileInt不支持十六进制。如果你想支持十六进制,你必须自己调用GetPrivateProfileString和解析它。

于 2013-02-01T14:49:27.010 回答