in reply to left shift problem

Is that postmassage as per the Windows API? Then I think that the parameters should be in a packed structure. Something like
$r = pack 'VV', $x, $y; # 8 bytes structure
("V" for Little-Endian, standard for Windows on Intel)

Since lParam can only hold a Long value, 32 bits, you probably need to pass a pointer to this 8 bytes structure, to PostMessage. I'm guessing that for this instance, you need to declare the PostMessage function with a "P" parameter, so it passes a pointer, in Win32::API.