-
December 15th, 2013, 05:09 AM
#1
Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
Hey ho..
Does anyone know how to show a child dialog with a hidden parent (SW_HIDE)?
I've got window HWND parent .. and now:
Code:
HWND child= CreateDialog( GetModuleHandle( 0 ), MAKEINTRESOURCE( IDD_child ), parent, WndProc_child );
ShowWindow( parent, SW_HIDE );
I would like to show my child dialog but when i hide my parent, the child would not appear... is there any other way of doing this... ?
my dialog must be parent's child...
gracias!
b
-
December 15th, 2013, 11:33 AM
#2
Re: Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
When you hide the parent, change the child's parent hwnd to a visible hwnd in your app. If all other hwnds are also hidden, use the desktop hwnd or NULL. When the true parent becomes visible, change the child's parent hwnd back to it again.
-
December 15th, 2013, 12:10 PM
#3
Re: Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
That is good idea, the only one prob here is that the moment i'd change that child's parent hwnd to some other visible hwnd is exactly the moment i would need the access to my "original" parent the most (by GetParent(child)) because i use the information chosen on dialog to properly display information on parent .. (user select enter some info, click ok, dialog closes and parent is displayed) ....so this isn't solution for me really...
i guess the most effective way here would be only to store my parent's hwnd on child's hwnd by e.g. SetWindowLongPtr .... or anyone has some other idea of showing child of hidden parent?
-
December 15th, 2013, 05:49 PM
#4
Re: Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
Originally Posted by berkov
That is good idea, the only one prob here is that the moment i'd change that child's parent hwnd to some other visible hwnd is exactly the moment i would need the access to my "original" parent the most (by GetParent(child)) because i use the information chosen on dialog to properly display information on parent .. (user select enter some info, click ok, dialog closes and parent is displayed) ....so this isn't solution for me really...
Sure it is.
Originally Posted by berkov
i guess the most effective way here would be only to store my parent's hwnd on child's hwnd by e.g. SetWindowLongPtr .... or anyone has some other idea of showing child of hidden parent?
Yep, if you need the parent window in the child, have the child save it off when it gets created. SetWindowLongPtr is a reasonable approach.
-
December 16th, 2013, 10:23 AM
#5
Re: Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
Originally Posted by berkov
Does anyone know how to show a child dialog with a hidden parent (SW_HIDE)?
[...]
Short, neat and clear, the answer is: NO WAY.
Have a look at these FAQs:
Both child and owned windows are hidden when the parent or owner is hidden.
-
December 16th, 2013, 11:03 AM
#6
Re: Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
Yes, I was thinking owned.
-
December 17th, 2013, 01:21 AM
#7
Re: Show Dialog (WS_CHILD) but with hidden (SW_HIDE) parent's window
Gents,
thanks a lot. I was just hoping that there's some trick for this but i guess SetWindowLongPtr is not so bad idea at the end.
thanks again!
SOLVED.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|