|
-
Oct 11th, 2006, 11:25 AM
#1
Thread Starter
Frenzied Member
[Resolved] Show window as modal dialog
Is there a way to display a client window created with CreateWindowEx(...) as a modal dialog, other than calling DialogBox(...)?
Ex:
A client window is created with CreateWindowEx and HWND_DESKTOP is specified as the parent. Then, another client is created with CreateWindowEx and the first hWnd is specified as the last's parent. This keeps the child window always on top of the parent but still allows the parent to be manipulated.
I don't think there is a way other than using a Dialog Box.
Last edited by wey97; Oct 20th, 2006 at 07:28 AM.
-
Oct 11th, 2006, 03:45 PM
#2
Re: Show window as modal dialog
Sure there is: you just need to emulate DialogBox. In other words, disable the parent window.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 11th, 2006, 04:09 PM
#3
Thread Starter
Frenzied Member
Re: Show window as modal dialog
 Originally Posted by CornedBee
Sure there is: you just need to emulate DialogBox. In other words, disable the parent window.
Yeah, the closest I've gotten is calling GetClassInfoEx with the #32770 dialog box class and changing the WndProc and Class Name. Find the window styles with Spy++ calling CreateWindowEx with no luck. The window isn't shown.
-
Oct 11th, 2006, 04:10 PM
#4
Re: Show window as modal dialog
Huh? Just call EnableWindow on the parent window handle!
Also, search http://blogs.msdn.com/oldnewthing/
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 11th, 2006, 04:40 PM
#5
Thread Starter
Frenzied Member
Re: Show window as modal dialog
 Originally Posted by CornedBee
Ok, so calling GetClassInfo to the dialog class was an admittedly bad idea I borrowed.
You're a lifesaver once again!
-
Oct 11th, 2006, 04:52 PM
#6
Thread Starter
Frenzied Member
Re: [resolved]Show window as modal dialog
One more thing. I assume the DialogBox or CreateDialog calls centers the dialog behind the scenes after the call to CreateWindow if the style DS_CENTER is specified. DS_CENTER has no effect if specified in CreateWindow.
So will I need to do this manually?
-
Oct 11th, 2006, 05:18 PM
#7
Re: Show window as modal dialog
Probably, yeah. DS_CENTER, as the DS prefix says, is a dialog-specific style, so it's a good guess that DialogBox and CreateDialog are responsible for handling it. (Or perhaps the dialog default procedure.)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|