title: Printing on Windows - Multiple Child windows
body: <p>I have an application with a window (created offscreen) that has multiple child HWNDs in it. How do I print it? </p>
  
  <p>I call PrintDdlg() and get the printing DC, fine. But how do I tell the main window to draw between the StartPage() /  EndPage() calls? It seems that I have to manually go through the children and call the draw code? Or do I send a WM_PRINT (or WM_PAINT?) message to the top level window. </p>
  
  <p>I can get some things printing on the screen, but its not obvious that I am doing it right.</p>
  
  <p>For instance: If I draw for a child window I usually get the child windows DC and use that. But will that work or do I need to only use the printing DC - in other words are the child window DC's smart enough to look up to the top parent and figure out that we are printing?</p>
  
  <p>I guess if anyone has seen some best practices on this I would be curious to see them. All the documentation for printing I can find is for trivial examples. </p>
  
  <p>This is in C++ with basically raw Win32 I am updating a decade old print loop.</p>
  
  <p>Right now my solution is to manually go through the window hierarchy from back to front and tell each child window to draw. I am having issues with text scaling, origin (every child window draws at top left which I can see), and other problems. These can all be fixed manually, of course. I am now off to spend hours on seeing if implementing WM_PRINT will work. All the examples on WM_PRINT deal with getting a microscopic bit map to draw into a memory based DC. But the docs for WM_PRINT kind of lead one to think its for printing. </p>