>I appreciate the reply, and have played with it for a while... Here's what I came up with...
>
>#DEFINE VK_SCROLL 0x92
>DECLARE INTEGER GetKeyboardState IN Win32API STRING @lpCodes
>lccodes = SPACE(256)
>= GetKeyboardState(@lccodes)
>
>lnSetting = ASC(SUBSTR(lccodes,vk_scroll,1))
>lnSetting = IIF(lnSetting=0,1,0)
>lccodes = SUBSTR(lccodes,1,(vk_scroll)-1) + ;
> CHR(lnSetting) + SUBSTR(lccodes,(vk_scroll)+1,LEN(lccodes))
>
>This grabs the setting, and changes it from 1>0 or 0>1 depending. My next question is this... I tried to add in a SetKeyboardState with the new lccodes, but kept receiving the message 'Too many parameters.'. I declared it the same way and tried to run it the same way as GetKeyboardState, but it failed. Am I forgetting something ?
>
>Thanks,
Hi Chris,
First, the array of bytes needs to be passed by reference to SetKeyboardState. Anyway, I just tested the following and it worked fine:
#DEFINE VK_SCROLL 0x92
DECLARE INTEGER GetKeyboardState IN Win32API;
STRING @lpCodes
DECLARE INTEGER SetKeyboardState IN Win32API;
STRING @lpCodes
lccodes = SPACE(256)
= GetKeyboardState(@lccodes)
lccodes = LEFT(lccodes, VK_SCROLL - 1) +;
CHR(BITXOR(ASC(SUBSTR(lccodes, VK_SCROLL, 1)), 1))+;
SUBSTR(lccodes, VK_SCROLL + 1)
= SetKeyboardState(@lccodes)
= keybd_event(VK_SCROLL, 0x45, KEYEVENTF_EXTENDEDKEY, 0)
= keybd_event(VK_SCROLL, 0x45, BITOR(KEYEVENTF_EXTENDEDKEY, KEYEVENTF_KEYUP), 0)
I haven't provided further details since you seem to have access to the SDK. Let me know if you need further details.
George
Ubi caritas et amor, deus ibi est