Fix a bunch of Windows UI x64 conversion warnings.
Fix some x64 type conversion warnings.
Return negative for UnscheduleEvent().

It usually won't be, but it could be negative.

Also some other minor warnings.
Fix some small constant-comparison type warnings.
Merge pull request #1186 from unknownbrackets/warnings

Warning cleanup