Based on J. H. Wallis' novel "Once Off Guard", the story features two surprise twists at the end. Screenwriter Nunnally Johnson, having written the script for "The Grapes of Wrath" (1940), was invited by International Pictures to a picture deal, and "The Woman in the Window" was chosen as its premiere project. According to some sources, Lang substituted the film's dream ending in place of the originally scripted suicide ending to conform with the moralistic Production Code of the time. However, Lang claimed that it was his idea when asked directly in an interview.