Well easy really by leaving avast on the default settings you don't get these 'on-access scanner messages'
Though as far as I'm aware this function isn't in the Instant Messaging (IM) provider, unless you mean the Internet Mail provider
In the Standard Shield - Left click on the avast 'a' icon, click the Details... >> button if shown, select the Standard Shield provider > Customize > Advanced - 'Show detailed info on performed actions' this option is off by default, so it would appear you have been tweaking avast without knowing the effect it will have.
This function is also on the Web Shield and Internet Mail providers so you should also check those.