1. Win32Lib: having a modal problem
- Posted by Dan Moyer <DanMoyer at PRODIGY.NET> Oct 05, 1999
- 283 views
- Last edited Oct 06, 1999
Hi all, I've found a problem in a program I'm making/modifying using Win32Lib which may be a result of me not knowing what I'm doing with "modal" windows. Basically it hangs up if I minimize a modal window, & then re-open that window instead of restoring it. The program has a main window with a set of buttons which select some "modal" windows. (I did that so each selected window would appear & stay "over" the main.) When I close each modal window, & then open another, there's no problem. But when I started MINIMIZING one and opening & minimizing another & another, (to test every action I could think of that a user could do), the program eventually hung up. This works ok: open modal window by clicking on button in main, click on "active app" icon at bottom of screen to minimize it (or click on minimize button on modal window), click again on "minimized" icon ON BOTTOM (to restore modal), close modal window, do other stuff. This is NOT ok: open modal window, (same as above) click on "active" icon at bottom to minimize, (same as above) click on BUTTON IN MAIN to open modal window AGAIN (which succeeds), close modal(which succeeds), then click anywhere in main: HANGS. I could (& in some instances did) remove the "minimize" button from the modal window(s), but this doesn't stop a user from minimizing the window by clicking on the "active" icon at bottom & causing the same hang-up. Have I made some kind of obvious mistake, or what? Dan Moyer
2. Re: Win32Lib: having a modal problem
- Posted by David Cuny <dcuny at LANSET.COM> Oct 05, 1999
- 282 views
- Last edited Oct 06, 1999
I haven't had a chance to read the error report in depth, but I suspect the problem is how I emulate modal windows. Basically, a modal window is a normal window. The difference is that when a 'modal' window is active, setting focus on any other of the application's windows causes the modal window to get focus. Closing a window doesn't cause it to be destroyed - it just makes it invisible. So I *suspect* that somehow that 'modal' window is becoming invisible, but the Win32Lib never clears the modal flag. As a result, every time you try to focus on an application window, Win32Lib shifts the focus to the invisible 'modal' window. As a result, your application appears to freeze up. I've got the stomach flu, so I suspect that I won't have a chance to look at the code in the next day or so. -- David Cuny