Re: Technical question about modal loops

From: Dean Roddey (droddey_at_charmedquark.com)
Date: 07/05/04


Date: Mon, 5 Jul 2004 10:27:00 -0700

Well, that doesn't seem right, but anyway, it's kind of irrelevant to the
issue at hand which is that, if it does really disable it, how does the
disabled window get any mouse events, because you can clearly see with Spy
that they are not arriving, and I can see in my modal loop that they don't
occur either. That's really the crux of the problem. They seem to be
providing some way for themselves to see input on that disabled window that
I don't know about.

In the meantime, I've pretty much found a solution that works ok for me. The
biggest problem I had was that, if I didn't disable the owner window, you
can still click on the task bar item and it would minimize the owner, but
leave up the owned. So, I just have my frame window class watch for size
events, and send a message to any of it's owned windows letting them know
it's minimizing or restoring, and the owned windows just go with it now. So
if you click the task bar, the owner any owned windows (and their owned
windows and so forth) just all minimize, and if you click it again, they all
restore. That's a reasonable compromize for me.

The owner isn't disabled, but since I control the message loop, I just
prevent them from seeing any user input, so I can catch their input and
blick the title bar and keep the owned window active.

And the owned windows, when activated, will bring their owner to the top of
the z-order (without activiation) so that they owned window always comes
forward with them.

Those things provide a quite reasonable implementation for me, which won't
ever do anything wierd to confuse my users. Though, I'd still like to know
what Windows is doing in order to be able to get that input on the disabled
owner so I could do that.

"John Carson" <donaldquixote@datafast.net.au> wrote in message
news:Ouivz5lYEHA.1652@TK2MSFTNGP09.phx.gbl...
> It disables its owner because, for the sake of the experiment, it calls
>
> HWND hwndOwner = GetWindow(hwnd, GW_OWNER);
> EnableWindow(hwndOwner, FALSE);
>
> in WM_CREATE. This, as I understand it, is more or less what a modal
dialog
> box does.
>
>
> --
> John Carson
> 1. To reply to email address, remove donald
> 2. Don't reply to email address (post here instead)
>



Relevant Pages

  • Re: Technical question about modal loops
    ... > someowhere in the owner when that app isn't active, ... > will not get an activate app message. ... > it gets a window position changing message, ... The owned window disables its owner when ...
    (microsoft.public.win32.programmer.ui)
  • Re: hide name box
    ... Add a Module and copy/paste all the code after my signature into its code window. ... ' Enables or disables a window. ... (ByVal hwnd As Long, _ ... Private Declare Function GetDesktopWindow Lib "user32" As Long ...
    (microsoft.public.excel.programming)
  • Technical question about modal loops
    ... When a standard dialog box comes up, it clearly disables it's owner. ... So there's no way a standard disabled window would ... Is the frame window not really disabled? ...
    (microsoft.public.win32.programmer.ui)
  • Re: some web pages force themselves in front of all other windows
    ... Chinese -- and if you've switched to another window while it's loading, ... There are two ways to stop this: You can disable meta-refresh in your ... Or you can find third-party software that disables ... But some web pages interrupt what I'm doing by ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Hide the Name Box
    ... ' Enables or disables a window. ... (ByVal hwnd As Long, _ ... Private Declare Function GetDesktopWindow Lib "user32" As Long ...
    (microsoft.public.excel.programming)