Hi Rob,
I think there is a bug in the acSendMessage code. When I send a message with an LParam that has the two high order bits set, the wrong value comes through in the actual message.
Here's what I'm doing: The {MEDIAPLAYPAUSE} message is not sent consistently on my computer. (I don't think this is a problem with S+, I have the same problem with the Play/Pause button on my keyboard.)
So to make sure the commands are sent all the time, I send the necessary <keyDown>, <char>, <keyUp> messages.
The first two messages are sent correctly, but the third one goes through with the wrong LParam.
local hWnd = acFindWindowByTitleRegex("iTunes")
acSendMessage(hWnd, 0x100, 0x20, 0x00390001) -- KeyDown
acSendMessage(hWnd, 0x102, 0x20, 0x00390001) -- Char
acSendMessage(hWnd, 0x101, 0x20, 0xC0390001) -- Key Up: This sends the wrong value for the LParam, actual value sent from S+ is 0x80000000 rather than 0xC0390001.
acPostMessage has the same problem.
I also tried using alien.core directly with user32.dll, but I couldn't ever get it to work for SendMessageA.
Matt