Possible updates for windows branch

I spent a few hours today updating my mingw dev environment in order to test the windows branch. I wasn't able to get it to compile(as I believe you still have the engine_dialog patch left to apply?) but these changes get me a bit closer. Please use if you think they are appropriate.