fixed passing of payloads via window messages to work properly on both Win32 and Win64
plus slightly more efficient pointer casting
Merge pull request #6 from socmag/master

Fixes for Win64