mIRC's behavior is such that private (direct to user) notices will be displayed in all channels in which you and the sender share in common.
So, to discover which channel windows those are, you would iterate through $comchan($nick,%i)
In addition, mIRC options allows you to show notices in the Active Window as well, so that window would be identified by $active
If $chan is populated in the On Notice event, then the target was a channel and not just to you privately. In which case, the notice would only appear in that channel window.
As of this time, there is no NOTICE command that allows you to notice a single person with a specific channel-context. On some IRCDs (networks), there exists a WHISPER command that does this.
Another thing that NOTICE allows is to target only a channel's ops, voices, or halfops by prefix, ie, "NOTICE @#mIRC That guy wants to get banned real bad." and the client command /onotice is an alias for this.
$target will be populated with "@#mIRC" on networks where this is supported.
Last edited by Raccoon; 13/10/19 10:46 PM.