Can anyone suggest a methodology that would allow our application to
start up (or be maximized by the user from the system tray) but not have
our application become the top window within the entire system and take
the system focus.
[snip
Our popup application's mainframe is constructed with the style
parameter wx.STAY_ON_TOPWe are using WinXP SP2, wxPython 2.8.2 and Python2.4.
Any suggestions ??
The wx.STAY_ON_TOP style will force your applications to be on top of
everything, regardless of the focus, I will presume this is what you are
after.
In terms of not letting your applicaion take the system focus, I'm not
sure that is possible. However, since your platform is Windows XP, you
may be able to use the win32gui module from pywin32 (included by default
in Python 2.5 and later I believe) to get the window that is focused in
the other application, to then perform a .SetActiveWindow() call:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.
That is to say, when your application is about to raise itself, you dig
through your target application, find the focus, restore yourself, then
set the active window to the other application's window.
That may or may not work, but it seems like it should. For information
about crawling through another application's window hierarchy, see
winAutoGui.py from Simon Brunning and his interesting series of posts on
GUI manipulation/scripting on Windows:
Small Values of Cool: Driving win32 GUIs with Python, part 1
winGuiAuto.py
Note that this is heavily Windows-centric. I have no idea how to do
this on other platforms.
- Josiah
ยทยทยท
"Geoff Skerrett" <Geoff@teammsa.com> wrote: