Originally Posted By: Khaled
If you use the above script, do you notice any difference in triggered events in the two situations that you described?

Yes. When switching between apps and all goes well, your script returns:

APPACTIVE appactive: $false
APPACTIVE appactive: $true
ACTIVE active: Status Window

When the issue appears, the order of events changes:

APPACTIVE appactive: $false
ACTIVE active: Status Window
APPACTIVE appactive: $true

Now that order also appears at times when the issue doesn't. But whenever the issue appears, that order does too.

As said, reproducing this is somewhat tricky. I've come up with a way that works most of the time, but it requires having the windows update notification icon in the system tray (or probably anything else that pops up a window with a slight delay).

- Click on the icon while mIRC is active (causes APPACTIVE appactive: $false)
- During the delay before the update dialog pops up, click into mIRC's window to reactivate it (causes ACTIVE active: Status Window)
- When the dialog has opened, click Cancel to close it, which will reactivate mIRC (causes APPACTIVE appactive: $true)

Of course I usually encounter the issue under different circumstances, but none of them reproduce it as reliably as the above (about 4 out of 5 times).