I have been testing this out and have had no luck either. As far as I can tell, PrintWindow() does not send WM_PRINTCLIENT, it sends WM_PAINT and it does not send WM_PAINT to hidden windows, so it cannot be used to capture hidden windows. With WM_PRINT, if a window is hidden, it does not capture the window frame or titlebar but will capture window contents if windows respond to WM_PRINTCLIENT. And with WM_PRINTCLIENT, similar issues to WM_PRINT.

I had the best results with SendMessage(hwnd, WM_PRINT, (WPARAM)hMemDC, PRF_ERASEBKGND | PRF_CLIENT | PRF_CHILDREN | PRF_OWNED) which allowed me to capture those parts of mIRC windows that support WM_PRINTCLIENT, such as the text display area.

It also turns out that rich editboxes do not support WM_PRINT/PRINTCLIENT, so the editbox in mIRC will appear blank. PrintWindow(), which uses WM_PAINT, does work with rich editboxes.

Which begs the question: do you know of any applications that are capable of reliably capturing hidden window contents? :-) Every discussion on this issue I have found through Google eventually concludes that it is not possible to do this reliably.