This is the first time that i am trying to use event monitors...

I have an event monitor that keeps watching for window popups that occur in my target application. I want to use this to handle unexpected messages in the target application.

My whenever event works well but is currently triggered for both expected and unexpected messages.

My question is how do i get TP to differentiate between an expected window popup and an unexpected window popup?

To rephrase my question... is there a way to prevent TP from triggering the event when i am expected the popup?

Here goes the code...

</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Dim monitor As TEventGroup
Dim condition As TWindowEvent

Set monitor = CreateTEventGroup(&quot;EventMonitor&quot
Set condition = WindowEvent(&quot;MsgPopUpEvent&quot
condition.AnyWindow = True
condition.AttachName = Window(&quot;PopUpMsgWindow&quot condition.AttachMode = tpAttachMode_ByAttachName
condition.WindowEventType = tpWindowEvent_Exists

monitor.AddCondition condition


monitor.Callback = &quot;HandleMyUnexpectedPopUp&quot;
SuspendScript </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">