This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Bug and Issues
 Resolved Bugs and Issues
 [CLOSED] acSendMessage - error sending LParam
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

imafishimafish

USA
19 Posts

Posted - 05/11/2012 :  16:20:33  Show Profile
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

imafishimafish

USA
19 Posts

Posted - 05/11/2012 :  16:26:02  Show Profile
Sorry, here's what I'm running:

Window 7, 64-bit
StrokesPlus
Version: 1.8.4
Release Date: 4/20/2012
Go to Top of Page

Rob

USA
2615 Posts

Posted - 05/11/2012 :  19:13:05  Show Profile  Visit Rob's Homepage
Try 1.8.8:

http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=340

The action functions were using lua_tonumber, which apparently defaults to a signed number, which is why you were getting 0x80000000 (the upper limit of a 32-bit signed integer). Changed those actions to use lua_tounsigned instead; should fix it, I used Spy++ to confirm the right value came through after the code change.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 05/12/2012 :  12:59:27  Show Profile  Visit Rob's Homepage
FYI, Matt.

Do post a response here as to whether or not it's working for you, then I'll close this bug.
Go to Top of Page

imafishimafish

USA
19 Posts

Posted - 05/13/2012 :  23:24:52  Show Profile
Works like a charm. I figured it would be an easy fix, but I didn't expect such a quick turn-around. I actually tested 1.8.9. Thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000