Is there a way for my application (in VB) to detect a mouse click on another application. Or detect a dialogue box opening in another application?

I am trying to write a program that could monitor the activaties of another program (written in VC). for testing purpose.