Hi guys.
A long time ago now, on OS4 as it happens, I discovered an issue with ActivateWindow(). It doesn't return when the window is activated as expected. Because of how Intuition works with it's event timers refreshing every 10th of a second or so. This has caused me trouble when working on a commodity that pastes text into the input stream. In some cases, where focus is taken away from the window, by the time the original window has been activated has been too late and my paste has been blanked out.
I wonder if there is any way to activate a window and be sure it has activated? The simple way would be to just delay using Delay() or timer.device. So I could do that.
I'm also thinking that an input handler or Cx filter could do the job. Waiting for the window to turn up in the activate event. Then signal my process.
Is there another way to call ActivateWindow() and be sure the window is activated, without other work arounds and patches to the system?
Just wait for an IDCMP_ACTIVEWINDOW event.
Thanks salass00. Unfortunately I can't do it that way. Since I'm running from a commodity my process doesn't own the window being activated. Although I do take the liberty of reactivating it since my commodity takes the focus off with it's own window. So I need to detect externally. If a gadget was active at the time it gets deeper as that needs to be reactivated as well. I perhaps should have asked this question in the context of a commodity rather than a general sense.