Тема: AHK: Как это перевести на AHK?
В другой программе используется такая команда:
<device type="hid" name="SpaceNavigator" vid="0x046D" pid="0xC626">
<command name="Led Off" report="0x0004" value="0x0000"/>
</device>
sendWindowMessage
type="CopyData"
window="SpaceNavigatorDriver"
message="HID;SpaceNavigator;Led Off"
Как ее написать для AutoHotkey? Я сделел так, не работает:
StringToSend := "HID;SpaceNavigator;Led On"
VarSetCapacity(CopyDataStruct, 12, 0) ; Set up the structure's memory area.
; First set the structure's cbData member to the size of the string, including its zero terminator:
NumPut(StrLen(StringToSend) + 1, CopyDataStruct, 4) ; OS requires that this be done.
NumPut(&StringToSend, CopyDataStruct, 8) ; Set lpData to point to the string itself.
DetectHiddenWindows On
SetTitleMatchMode 2
SendMessage, 0x4a, 0, &CopyDataStruct,, SpaceNavigatorDriver ; 0x4a is WM_COPYDATA. Must use Send not Post.