1. Win32Lib: minimize modal window/re-open/system hang

David,

Have you had an opportunity to think about that "minimize modal window/re-
open/system hang" problem I found?

To refresh:  if a user clicks on a button in my app to open a modal window,
and then for no good reason goes down to the taskbar at the bottom of the
screen & clicks on the small icon for that modal window, minimizing it,
then goes back up to the button that opens the modal window & clicks on IT
to bring back the window (instead of clicking again at the bottom icon),
then closes the modal window, any next click in the main hangs the system.

Since my app is  math flash cards for kids, I'm worried that sooner or
later they will hang their system.

Below is a demo, made using your IDE  :)

Dan Moyer

-- demo of modal window/minimize/re-open problem:

include Win32Lib.ew
without warning

global constant TheWindow = create( Window, "The Window", 0, Default,
Default, 780, 448+ 19, 0 )
global constant PushButton1 = create( PushButton, "Open Modal Window",
TheWindow, 296, 356, 184, 64, 0 )
global constant LText2 = create( LText, "LText2", TheWindow, 109, 49, 600,
192, 0 )
global constant aModalWindow = create( Window, "MODAL WINDOW", TheWindow,
280,370,200,100,or_all({ WS_THICKFRAME, WS_SYSMENU}))

constant
Cr = { 13, 10 }
----------------------------------------------------------------------------
procedure TheWindow_onOpen ()
  setText(LText2,"1. click OpenModalWindow button;" & Cr &
  "2. Go down to task bar and click on Modal windows icon to minimize it;"
& Cr &
  "3. Now click AGAIN on the OpenModalWindow button to RE-OPEN it;" & Cr &
  "4. Now CLOSE the modal window;" & Cr &
  "5. NOW if you click anywhere in this main window, program will hang.")
end procedure

onOpen[TheWindow] = routine_id("TheWindow_onOpen")
----------------------------------------------------------------------------
procedure PushButton1_onClick ()
  openWindow ( aModalWindow , Modal )
end procedure

onClick[PushButton1] = routine_id("PushButton1_onClick")
----------------------------------------------------------------------------
WinMain( TheWindow, Maximize )

new topic     » topic index » view message » categorize

2. Re: Win32Lib: minimize modal window/re-open/system hang

Dan Moyer wrote:

> Have you had an opportunity to think about that "minimize modal
> window/re-open/system hang" problem I found?

No; thanks for the example.

I'm trying to get a version of Win32Lib with a number of other fixes packed
together, but I don't think I'll be able to track it down in this release. I
probably won't get a chance to get it posted tonight, either. sad

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32Lib: minimize modal window/re-open/system hang

Dan:

I tried duplicating your program using Delphi, to see if this
might have something to do with the way Windows works.
Interestingly enough, MODAL windows in Delphi do not even
add an icon or button on the taskbar, so there's no way to
test further. Perhaps that may give a clue, however, in what
may be the cause of this problem.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

4. Re: Win32Lib: minimize modal window/re-open/system hang

Thanks Irv,

That does seem interesting, & I noticed something else that at least looks
similar to your observation: a 'messagebox' seems to be a "modal task",
like a modal window, but when I click on an "about" menu choice that
displays a message box in programs developed using Win32Lib, that box ALSO
does NOT add a icon onto the task bar.  And if there's no way to minimize
the modal window, then that works around the problem.  So what determines
if a task is put on the taskbar??

Dan

On Wed, 10 Nov 1999 11:17:54 -0500, Irv Mullins <irv at ELLIJAY.COM> wrote:

>Dan:
>
>I tried duplicating your program using Delphi, to see if this
>might have something to do with the way Windows works.
>Interestingly enough, MODAL windows in Delphi do not even
>add an icon or button on the taskbar, so there's no way to
>test further. Perhaps that may give a clue, however, in what
>may be the cause of this problem.
>
>Regards,
>Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32Lib: minimize modal window/re-open/system hang

From: Dan Moyer <DanMoyer at PRODIGY.NET>

Subject: Re: Win32Lib: minimize modal window/re-open/system hang

> That does seem interesting, & I noticed something else that at least looks
> similar to your observation: a 'messagebox' seems to be a "modal task",
> like a modal window, but when I click on an "about" menu choice that
> displays a message box in programs developed using Win32Lib, that box ALSO
> does NOT add a icon onto the task bar.  And if there's no way to minimize
> the modal window, then that works around the problem.  So what determines
> if a task is put on the taskbar??

The difference I see is that messagebox is a built-in function of Euphoria,
while the
other modal windows are created by Win32Lib. Therefore, it seems reasonable
to
assume that there is something not being set properly in Win32. It will take
someone
who knows more about Windows to find out what that something is.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32Lib: minimize modal window/re-open/system hang

Irv wrote:

> I tried duplicating your program using Delphi, to see if this
> might have something to do with the way Windows works.
> Interestingly enough, MODAL windows in Delphi do not even
> add an icon or button on the taskbar, so there's no way to
> test further. Perhaps that may give a clue, however, in what
> may be the cause of this problem.

Win32Lib doesn't use real modal windows, but instead simulates them. This
allows me to use the same controls on modal windows that are used on normal
windows. The bug is probably a Win32Lib logic bug, not a Windows bug

Modality is simulated by not allowing other windows in the Win32Lib
application to get focus. If they try to get focus, the focus is redirected
to the 'modal' window.

When the 'modal' window is closed (hidden, actually), the modal flag is
*supposed* to be clear. What is sounds like is happening is that the modal
window is being closed, but the internal flag isn't clearing. As a result,
Win32Lib won't let you focus on any of the windows - it keeps redirecting
the focus to the closed (hidden) 'modal' window.

Since the 'modal' window is hidden, it looks like the application has locked
up.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

7. Re: Win32Lib: minimize modal window/re-open/system hang

Dan Moyer wrote:

> Have you had an opportunity to think about that "minimize modal window/re-
> open/system hang" problem I found?

I tried the code in Win32Lib 0.44e (not released yet; I can't FTP to my ISP
for some reason), but it should work with the version that I have posted on
my web site:

    http://www.lanset.com/dcuny/win32.htm

If not, I'm not following your instructions correctly.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

8. Re: Win32Lib: minimize modal window/re-open/system hang

David,

I doubt you're not following my instructions, so I'll try different
versions of Win32Lib; but which version are you refering to?  You have a
0.44b (Oct 20) at your site, & a 0.43e (I think that was Oct 14?), and
other previous ones, and then in bleeding edge, ANOTHER 0.44b (but Nov.
13). I THOUGHT I was running your 0.43e (Oct 14?), but turns out I was
running 0.42e.

Wolfgang sent me a workaround, #C40000 as last parameter in create yields a
child window which not only has no minimize button (which I had already
done),but also PUTS NO ICON ON THE TASK BAR, which completely eliminates
any opportunity for the user to minimize the window & invoke the problem.

Dan Moyer


On Fri, 12 Nov 1999 08:59:41 -0800, David Cuny <dcuny at LANSET.COM> wrote:

>Dan Moyer wrote:
>
>> Have you had an opportunity to think about that "minimize modal
window/re-
>> open/system hang" problem I found?
>
>I tried the code in Win32Lib 0.44e (not released yet; I can't FTP to my ISP
>for some reason), but it should work with the version that I have posted on
>my web site:
>
>    http://www.lanset.com/dcuny/win32.htm
>
>If not, I'm not following your instructions correctly.
>
>-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu