Bringing a Window to the Top

I'm having some trouble getting a wxWindow to go to the top of
the stack and become the visible and active window (among all
on the machine, not just in the app).

I've tried using:

  win32gui.SetForegroundWindow(someWxFrame.GetHandle())

That doesn't seem to work when another app is on top.

Also tried

  someWxFrame.Raise()

Didn't succeed with that either.

Are these supposed to work in such situations?

My setup is wxPython 2.4.2.4, Windows NT SP6a (IIRC), python 2.3.2.

What's the preferred way to do this?

TIA for any info.

Al

achrist@easystreet.com wrote:

I'm having some trouble getting a wxWindow to go to the top of
the stack and become the visible and active window (among all on the machine, not just in the app).

I've tried using:

  win32gui.SetForegroundWindow(someWxFrame.GetHandle())

That doesn't seem to work when another app is on top.

Also tried

  someWxFrame.Raise()

Didn't succeed with that either.

Are these supposed to work in such situations?

Look at MSDN for SetForegroundWindow. IIRC it talks about how there are restrictions on which process can bring a window to the top of the z-order.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!