Discussion:
VC++ 2012 hiding the calling dialog window
(too old to reply)
Me
2015-04-13 14:17:59 UTC
Permalink
I have my main dialog do a DoModal to bring to the foreground another
dialog. How do I hide the main dialog that still shows in the background?
TIA

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
R.Wieser
2015-04-13 16:25:22 UTC
Permalink
"Me",

In the child-dialog find out who its parent is (the main dialog in the
background) and than send a ShowWindow with the SW_HIDE argument.

Just do not forget the show the main dialog again (using SW_SHOW) *before*
terminating the child dialog -- the main dialog can un-hide itself, but
putting itself at the foreground will not work (not when the focus has
already shifted to another window)

Regards,
Rudy Wieser
Post by Me
I have my main dialog do a DoModal to bring to the foreground another
dialog. How do I hide the main dialog that still shows in the background?
TIA
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
Me
2015-04-14 11:42:41 UTC
Permalink
How does the child check who called it?
Post by R.Wieser
"Me",
In the child-dialog find out who its parent is (the main dialog in the
background) and than send a ShowWindow with the SW_HIDE argument.
Just do not forget the show the main dialog again (using SW_SHOW) *before*
terminating the child dialog -- the main dialog can un-hide itself, but
putting itself at the foreground will not work (not when the focus has
already shifted to another window)
Regards,
Rudy Wieser
Post by Me
I have my main dialog do a DoModal to bring to the foreground another
dialog. How do I hide the main dialog that still shows in the background?
TIA
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
R.Wieser
2015-04-14 14:29:56 UTC
Permalink
Me,
Post by Me
How does the child check who called it?
No, not who called it, but who is its parent. If your called dialog has
not been told who its parent is (using the hWnd argument) its most likely
you cannot set it to modal either.

The functions name is, IIRC, GetParent.

Regards,
Rudy Wieser
Post by Me
How does the child check who called it?
Loading...