Various changes to improve the behaviour of kiosk mode for DocumentWindows on win32.