How do I display a dialog to a file, rather than the screen

I'd like to get a capture of a dialog in Windows XP using C++ without actually displaying the dialog on the screen. I'd use this for auto-generating help files for my application. I'm thinking there should be a way to make the display machinery think that a file is the screen, and display the image of the dialog there, rather than the screen, giving me a capture of the dialog without actually displaying it on screen.