I wouldnt use WM_QUIT to unsubclass. If mIRC was the subclassed window and the user clicked "No" to the confirm dialog then your subclass will be removed even tho mIRC wasnt actually closed. mIRC uses WM_QUIT to display the confirm on close dialog.

Im curious as to how your controlling other dll's (that arent using your patch) in the unsubclass. You will still end up with a broken chain because dll's not using your file will simply unsubclass w/o calling a safe routine. My last attempt used api hijacking to control SetWindowLong but still required that all the dll's loaded be compiled with my lib. i.e it had a msg manager and added subclassed windows to a tree when the dll called SetWindowLong.