Using SetWindowPos then showing a modal dialog causes modeless window to lose its child wndows... :( 
Author Message
 Using SetWindowPos then showing a modal dialog causes modeless window to lose its child wndows... :(

Has anyone seen this before?

I am using SetWindowPos to maintain a Z-Order relationship between two a
top-level window and a modeless dialog. Since the top-level window is not a
C# window I can't make it the owner of my modeless C# window (that's the
topic of another posting). To get around this I am using SetWindowPos with
some basic logic to control the Z-Order of the client (top-level) window and
the modeless window.

Now, here's the problem. After I show a MessageBox (i.e., when the
MessageBox closes) the modeless window loses all of its child windows. They
just disappear and I am left with a pretty dull looking window to say the
least. Using Spy++ I can see those child windows are no longer there and the
WindowsFormsParkingWindow has changed from being the next window to being
the previous window w.r.t my modeless window.

Any insights on this would be appreciated...

Regards,
Wayne.



Mon, 27 Dec 2004 01:37:55 GMT  
 Using SetWindowPos then showing a modal dialog causes modeless window to lose its child wndows... :(

Quote:
>Has anyone seen this before?

>I am using SetWindowPos to maintain a Z-Order relationship between two a
>top-level window and a modeless dialog. Since the top-level window is not a
>C# window I can't make it the owner of my modeless C# window (that's the
>topic of another posting). To get around this I am using SetWindowPos with
>some basic logic to control the Z-Order of the client (top-level) window
and
>the modeless window.

>Now, here's the problem. After I show a MessageBox (i.e., when the
>MessageBox closes) the modeless window loses all of its child windows. They
>just disappear and I am left with a pretty dull looking window to say the
>least. Using Spy++ I can see those child windows are no longer there and
the
>WindowsFormsParkingWindow has changed from being the next window to being
>the previous window w.r.t my modeless window.

>Any insights on this would be appreciated...

It looks like a program written in C#. Please re-post this questin to C#
group. Thanks.

--
Peter Wu
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.



Mon, 27 Dec 2004 10:49:06 GMT  
 Using SetWindowPos then showing a modal dialog causes modeless window to lose its child wndows... :(
Thanks. I realized that yesterday and posted it to C#.



Quote:
> >Has anyone seen this before?

> >I am using SetWindowPos to maintain a Z-Order relationship between two a
> >top-level window and a modeless dialog. Since the top-level window is not
a
> >C# window I can't make it the owner of my modeless C# window (that's the
> >topic of another posting). To get around this I am using SetWindowPos
with
> >some basic logic to control the Z-Order of the client (top-level) window
> and
> >the modeless window.

> >Now, here's the problem. After I show a MessageBox (i.e., when the
> >MessageBox closes) the modeless window loses all of its child windows.
They
> >just disappear and I am left with a pretty dull looking window to say the
> >least. Using Spy++ I can see those child windows are no longer there and
> the
> >WindowsFormsParkingWindow has changed from being the next window to being
> >the previous window w.r.t my modeless window.

> >Any insights on this would be appreciated...

> It looks like a program written in C#. Please re-post this questin to C#
> group. Thanks.

> --
> Peter Wu
> Microsoft Corporation

> This posting is provided "AS IS" with no warranties, and confers no
rights.



Mon, 27 Dec 2004 21:42:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to show a Modeless window on a modal window

2. Most down window shows up with modal dialog

3. Modal Common Dialog Boxes using Windows API Calls

4. Problem using SetWindowPos on modal form (VB5)

5. Problem using SetWindowPos on modal form (VB5)

6. Modal Form gets lost after a Hide/Show

7. losing events in modal dialogs

8. Connection Point Events Lost When Modal Dialog Open

9. vb4.0 32-bit common dialog box causes focus to be lost

10. Showing Modal Dialog Boxes in COM Add-Ins

11. Show BrowseForFolder API dialog as Modal?

12. GetOpenFilename API shows a non-modal dialog

 

 
Powered by phpBB® Forum Software