RE: Message box bug
- Posted by Brian Broker <bkb at cnw.com> Jan 07, 2002
- 370 views
This is a known bug. I don't know about the minimizing but you will lose focus on your main window. Here is what Derek had to say about it: Somebody once asked: >Why does invoking the message box from winDos cause the entire >application to be shoved into the background when winDos is >closed? And how can I prevent this from happening? I consider >this a very serious (i.e. totally unacceptable) user interface >flaw with my program. I suspect its because that message_box() is *not* a part of the win32lib library, thus it sets the "owner" window to NULL. When Windows closes, it has no knowledge of which window it was invoked from, so Windows just sets focus to some window. What method it uses I don't know, but I guess its not "last used". As a work around, you might need to specifically set the focus to the window of your choice via setFocus(id), when message_box() returns. I'm thinking of bring something like message_box into the library, in which case you can have much more control over its behaviour. ----- cheers Derek Parnell Jasper wrote: > Hi everyone, > > There seems to be a bug with the message box. The situation is this: I'm > > in the main window and open a second window. When I close that window I > return to the main window. No problem there. However when I'm in the > main window and open a second window, and while the second window is > active a message box is generated and I close that message box and then > close the second window, the main window gets minimised. I tried to work > > around it with a switch in the part that generates the message box but > the minimalisation is not recognised by onResize, onChange nor > onLostFocus. Any idea what's going on? > > Bye, > > Jasper. > >