The example in the mIRC help with getting hwnd isn't even necessary in .NET. I've made mIRC DLLs in .NET and the only thing I needed to do was check the box that said "Register for COM Interop.