win32 support for changing cursor shape

Based on a patch from Jay Sorge. See commit message for deatils.