We previously rolled our own text <-> int conversion code for the dialogs. Use winapi's built-in one instead. While we're at it, fix some indentation and a return-code.