More manual merging of Win32 changes

This completes the manual merge (PR #1365) for the Win32 changes that @monkeyiq and I did. There were also some leftover naming conflicts over PrintDlg.

~~Not to be merged yet, because my compile on Windows hasn't finished yet.~~
~~It compiles fine on Windows. Now for Travis.~~

~~Well it's now crashing if I open then close the glyph editor - whether or not this is because of the commits unrelated to win32 since, I don't know.~~