[Continued]

To answer your first question, "What will the end result be?"... Hopefully a whole bunch of DLL files that can interoperate without knowing anything about the other DLL's being used. And maybe even the development of a mIRC DLL SDK. (wishfull thinking) smile

When multiple DLL's subclass the same window, problems can occur when unsubclassing (in the traditional way). Take for example two DLL's that subclass the toolbar's WndProc. I load DLL 'A' and than DLL 'B'... DLL 'B' is the first WndProc to receive messages (as it was the last to do a SetWindowLong()). At the end of 'B' proc, 'A' proc is called (because SetWindowLong()) returned the previous window proc). At the end of 'A' proc, mIRC's WndProc is called and than DefWindowProc() is called. That a chain...

Now let's say that DLL 'A' needs to unload before DLL 'B'... Without using the Subclassing API, you will have a problem. The chain will be broken, because DLL 'B' wants to call DLL 'A' when it's finished. But DLL 'A' is gone. The result is a crash.

My Subclassing API prevents this problem and simplifies the amount of work a DLL programmer need to put in to writing a subclassed WndProc.