Anonymous wrote:
i tried it with win 7 64b, in device descriptions some chinese like unreadable words which detected 10 devices, and when i click on the devices nothing is displayed on the device info. what to do next.
I think this isn't a 64-bit issue, but rather an Ansi vs. Unicode issue. The DLL is expecting Ansi strings, but if you're using AutoHotKey_L then your script may be expecting Unicode strings.
I made some tweaks to the AutoHotkeyRemoteControlDLL.ahk script to convert the strings to Unicode so they can be displayed properly.
You could also try using the original AutoHotKey, which doesn't support Unicode, so there's no ambiguity in string format. More information on that is here:
http://l.autohotkey.net/file/users/Members/Lexikos/AutoHotkey_L/docs/Compat.htm
Here are my changes. You really only need the first one (Str -> AStr) to have the script function. The others are just prettying up the display names of the devices, which is not critical.
Code:
27c32
< strRC := DllCall("AutohotkeyRemoteControl\GetDeviceType", Int, A_Index-1, "Cdecl Str")
---
> strRC := DllCall("AutohotkeyRemoteControl\GetDeviceType", Int, A_Index-1, "Cdecl AStr")
77,78c82,84
< VarSetCapacity(Name, 500) ;Reserve more space than needed.
< nRC := DllCall("AutohotkeyRemoteControl\GetMouseDeviceInfo", INT, nCount, "INT *", DevID, "INT *", BtnNr, "INT *", SampleRate, INT, NameSize, Str, Name, "Cdecl Int")
---
> VarSetCapacity(AnsiName, 500) ;Reserve more space than needed.
> nRC := DllCall("AutohotkeyRemoteControl\GetMouseDeviceInfo", INT, nCount, "INT *", DevID, "INT *", BtnNr, "INT *", SampleRate, INT, NameSize, UInt, &AnsiName, "Cdecl Int")
82a89,92
> ; Convert from returned UTF8 to script's native Unicode
> Name := StrGet(&AnsiName, -1, UTF-8)
98,100c108,111
< VarSetCapacity(Name, 500)
< nRC := DllCall("AutohotkeyRemoteControl\GetKeyDeviceInfo", INT, nCount, "INT *", nSubType, "INT *", nKeyboardMode, "INT *", nFuncKeyCount, "INT *", nIndicators, "INT *", nTotalKeys, INT, NameSize, Str, Name, "Cdecl Int")
---
> VarSetCapacity(AnsiName, 500)
> nRC := DllCall("AutohotkeyRemoteControl\GetKeyDeviceInfo", INT, nCount, "INT *", nSubType, "INT *", nKeyboardMode, "INT *", nFuncKeyCount, "INT *", nIndicators, "INT *", nTotalKeys, INT, NameSize, UInt, &AnsiName, "Cdecl Int")
104a116,119
> ; Convert from returned UTF8 to script's native Unicode
> Name := StrGet(&AnsiName, -1, UTF-8)
122c137
< VarSetCapacity(Name, 500)
---
> VarSetCapacity(AnsiName, 500)
124c139
< nRC := DllCall("AutohotkeyRemoteControl\GetHIDDeviceInfo", INT, nCount, "INT *", dwVendorId, "INT *", dwProductId, "INT *", dwVersionNumber, "INT *", usUsagePage, "INT *", usUsage, INT, NameSize, Str, Name, "Cdecl Int")
---
> nRC := DllCall("AutohotkeyRemoteControl\GetHIDDeviceInfo", INT, nCount, "INT *", dwVendorId, "INT *", dwProductId, "INT *", dwVersionNumber, "INT *", usUsagePage, "INT *", usUsage, INT, NameSize, UInt, &AnsiName, "Cdecl Int")
128a144,147
> ; Convert from returned UTF8 to script's native Unicode
> Name := StrGet(&AnsiName, -1, UTF-8)