Change registry API to support older windows versions + SetWindowLongPtrW -> SetWindowLongW

Separate commits, pull if you like them.