Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Child window same as Modal dialog.

41 views
Skip to first unread message

amitm...@gmail.com

unread,
Jun 15, 2010, 9:34:01 AM6/15/10
to
Hi All,
I have window which has a "Launch window" menu. Once user will click
this menu new child window gets launched.
Now I want to block the parent window. Same as the DoModal() function
do in case of dialog box.
User should not do any thing on parent window until child window gets
destroyed.
Please help me to solve this issue.
Thanks in advance.

Thanks and regards,
Amit

Joseph M. Newcomer

unread,
Jun 15, 2010, 10:06:51 AM6/15/10
to
See below...
On Tue, 15 Jun 2010 06:34:01 -0700 (PDT), "amitm...@gmail.com" <amitm...@gmail.com>
wrote:

>Hi All,
>I have window which has a "Launch window" menu. Once user will click
>this menu new child window gets launched.
>Now I want to block the parent window. Same as the DoModal() function
>do in case of dialog box.

****
Then why not use a modal dialog? Wouldn't that be much simpler?
****


>User should not do any thing on parent window until child window gets
>destroyed.

****
GetParent()->EnableWindow(FALSE);

would be a good start.
****


>Please help me to solve this issue.
>Thanks in advance.
>
>Thanks and regards,
>Amit

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

amitm...@gmail.com

unread,
Jun 16, 2010, 1:14:15 AM6/16/10
to
Hi Joseph,

Thanks for your feedback.

I can't use the dialog box in my case as i have to do some drawing
operations on client area of window.

Also I tried the GetParent()->EnableWindow(FALSE); but i didn't worked
for me.

Goran

unread,
Jun 16, 2010, 7:40:10 AM6/16/10
to
On Jun 16, 7:14 am, "amitman...@gmail.com" <amitman...@gmail.com>
wrote:

> I can't use the dialog box in my case as i have to do some drawing
> operations on client area of window.

That doesn't preclude the use of a CDialog. You can simply draw on the
dialog, but you can also write your own window class (that draws what
you want, and put it in the dialog, as a child window). I'd go for
that.

Goran.

Joseph M. Newcomer

unread,
Jun 16, 2010, 10:05:52 AM6/16/10
to
That doesn't even make sense. The correct approach would be to use a modal dialog, put a
CStatic in it, and move your OnPaint to the CStatic class!

This is a case of solving the wrong problem in the wrong way! Frankly, it would never
have occurred to me to use a CWind-derived child window when a CDialog is so much simpler!

No matter what you want to do for drawing, a modal CDialog with a child control that does
your drawing would be a bettr approach. Otherwise, you are trying to re-create something,
and will probably end up with an unsupportable kludge.
joe

On Tue, 15 Jun 2010 22:14:15 -0700 (PDT), "amitm...@gmail.com" <amitm...@gmail.com>
wrote:

>Hi Joseph,

0 new messages