Used specific Windows API calls.
Removed conversion warnings.