#Windows
5 messages in this thread
Ray,
No, I don't want to close the window, it needs to remain visible. I
would just like to give the window the user was in back to them when I exit.
Mike
Mike, I'm confused… you said 'when I exit.' and I thought that meant when
your program exits. Are you exiting your program and leaving a window
behind??? If your window does not need to be activated at all then just
don't set the ACTIVATE flag and whatever window was active when your
program opens it's window will still be active. Ray
Ray,
Sorry about the confusion. The user will select a string gadget in the
window to use the program, activating the window. After the program responds,
its work is done and the user wants to continue with his/her work. My program
remains active, waiting to be called upon. I was trying to think of the user
and not require him to click on the window he was in before.
Mike Cook
Mike, in that case, (now that I know what's going on 🙂 , I think your best
bet is to do like someone already said.. find the active window, save a
pointer to it, then activate it with ActivateWindow(). Only two problems I
see there.. You'll have to find a way to verify that the window is still
there before you call ActivateWindow(). Also, what if the active window was
on another screen?? Hmm…. Ray
In order to do want you want with the least amount of fudging around you
should create an InputEvent handler so that you can receive _every_
ACTIVEWINDOW and INACTIVEWINDOW message that occurs in the system. You
can't do this just from your IDCMP port since it will announce the change
of state of your window, none of the other windows.
When you receive an INACTIVEWINDOW message, save the ie_EventAddress
element, this points to the window that was deactivated. If the very next
ACTIVEWINDOW message points to your window then you have what you want,
otherwise, throw it away and wait for another INACTIVEWINDOW event.
The priority you should use is 51, one higher than Intuition. Hope this
gets you started.