this happened to me recently, was forced to work on rear brake at an inclining parking stall..I forgot to shut the door after putting it all back together and about to test it. WHAM! window frame hit the stall's 6" steel skeleton...bent window frame..
1 long piece of 2"x4" plywood, and some nylon string, cut 2x4 wood to 2 2ft and leave the last long piece untouched. tie 1 of the short 2x4 to the window frame, press the other short wood to door panel's interior, and wedge the long piece between the 2. heave-ho! Pull! fixed.
apply liberal amount of grease to hinge and dead bolt and call it a day.