extract method CreateWindowAndContext in WindowSDL to simplify setup