Thank you,
Just one mistake, it's good with an untested code:
WAIT WINDOW "Shift keys: " + IIF(BITAND(lnResultL, 0x8000)#0, "Left ", SPACE(0)) +;
IIF(BITAND(lnResultR, 0x8000), "Right"#0, SPACE(0))
I'll do just save at form with click and save and exit with shift+click. It'll be good...
>>Hi All,
>>Is there a way catch if shift key pressing at toolbar buttons click method?
>
>
>You can always obtain the state of the any of the keyboard keys at any time by using the GetAsyncKeyState() WIN32 function:
>
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293%28v=vs.85%29.aspx>
>The codes you would pass to it are (untested, but something similar should work :-)):
>
>
#define VK_LSHIFT 0xA0
>#define VK_RSHIFT 0xA1
>
>DECLARE SHORT GetAsyncKeyState IN USER32.DLL INTEGER nVKey
>
>lnResultL = GetAsyncKeyState(VK_LSHIFT)
>lnResultR = GetAsyncKeyState(VK_RSHIFT)
>
>WAIT WINDOW "Shift keys: " + IIF(BITAND(lnResultL, 0x8000), "Left ", SPACE(0)) + IIF(BITAND(lnResultR, 0x8000), "Right", SPACE(0))
>
>
>If you do this as the first operation of your click() event, the shift key will likely still be down so the return value will be valid in that case (if you can't check it any other way).
>
>Here are codes also for Shift, Control, and Alt:
>
#define VK_LSHIFT 0xA0
>#define VK_RSHIFT 0xA1
>#define VK_LCONTROL 0xA2
>#define VK_RCONTROL 0xA3
>#define VK_LMENU 0xA4
>#define VK_RMENU 0xA5
>
>
>The other virtual key codes are here:
>
http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx>
>You can also obtain the system mouse position similarly using GetCursorPos() (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390%28v=vs.85%29.aspx ) but it requires some more complex extraction to obtain the offsets. See the post I wrote in my message history about the UTC to Local time for the algorithms to extract the 16-bit portions.