If you subclass the window manually send the WM_PAINT message to the old procedure (within your WM_PAINT that is)
Careful with the use of the word "manually" if you're unfamiliar with subclassing someone might read that as use SendMessage/PostMessage or even manually call the WNDPROC, when really they should be using CallWindowProc.
Also just a question, since I haven't played much with WM_PAINT. Can't what you suggested cause some problems? I mean when you receive WM_PAINT you call BeginPaint and when you end you call EndPaint, right? So if mydll. calls BeginPaint, then does CallWindowProc to send the WM_PAINT to mIRC, won't mIRC again call BeginPaint? Meaning, if the update region were set to be erased, and WM_ERASEBKGND were sent, wouldn't this cause the erase background message to be sent twice? Or does the "do erase flag" get cleared after the first time BeginPaint was called?