You can use Saturn's io.dll for this sort of things. It's version-dependent but Saturn promptly updates it with each new version of mirc.