Ok, I'm going to venture out and say this is a fixable bug with mIRC. It's been bugging me for years now. I finally understand the problem well enough to document it and a solution. I started to document the problem here -> Problem Description

Solution: WM_CLOSE must not unload DLL's. WM_CLOSE needs to return, so that if the mIRC app window is subclassed, it can be removed from the WNDPROC chain properly. mIRCProc for WM_CLOSE should only post it's WM_DESTROY. Then on WM_DESTROY, unload the DLL and send all children WM_DESTROY/WM_MDIDESTROY, etc...