uhmmm if I am correct about what you are trying to do:

mIRC has an identifyer to check if it's the active application... so you don't need a dll

search the /help for it!