Lets say I have a window (or dialog) which displays some info, contains controls or whatever. It's possible I could show just that dialog if I want. But what if I wanted to make it appear to be a part of another window instead. A good example would be if I had a window with tabs on it. Then, I could dynamically parent a child to a particular tab as I please, rather than showing it as a window as would normally be. Any one have source? I've read in the past "do this" or "do that"... great... I've learned nothing... anyone have source so I can see how it's done (A very simple sample would be okay) then I can take it from there. Thanks, _Shawn
Posted on 2001-03-19 17:49:00 by _Shawn
Shawn, I'm not sure I understand what you are asking. Are you saying the dialog should be free of the parent, or locked on the parent, or a single dialog that displays different children depending on what tab was clicked? ------------------------ "And remember not to act afraid. Animals can smell fear. And they donít like it."
Posted on 2001-03-19 23:04:00 by Ernie
I was probly being confusing... huh? I mean this... lets say I have a for with tabs (tab control). Then, I have another form. Instead of displaying it, I want it to appear in one of the tabs. For what use? If I have a plug in and it has a configuration form, I want to show it inside a nice "Preferences" dialog instead of as a standalone dialog. What I'm asking is, if I have one form, how to I make it become a part of another form... to display it in the contents of another form rather than a standalone... I'm not talking VB (form), I'm talking win32. Thanks, Shawn
Posted on 2001-03-20 01:25:00 by _Shawn
Shawn, I think what you are after is pretty straight forward, you want to use a dialog window as a child window of another window. Set the other window as its parent and set the child window style to WS_CHILD style, you position it by pixel location like normal. Be carefule with dialog boxes in this format because they are dependent on the size of the system font which can change from one machine to another. If you wish to use a dialog as a child window, make sure you measure its size first and autoscale the rest of the interface to fit it. Sorry, no examples but when you get it going, save it as one. :) Regards, hutch@pbq.com.au
Posted on 2001-03-20 02:02:00 by hutch--
Hutch, Thanks... I found the SetParent API. This works remarkably well. once I figure out how to hide Dialogs in DLL's, I'll have an example. In the meantime, this leads me to my next question: lets say I have an MDI window and I want a part of some window to attach to some side of it, say, the left for example. How do adjust the client area appropriately so that the window on the left isn't on top of the client area? I'm not talking about docking, although that's the best way to describe it. I want this to be permanantly fixed to that side. Is there an API for this? Thanks, Shawn Updated: Hutch, I just found the "AdjustWindowRect" API which does that. I'm working on an API spy tutorial and I was watching another program all these API's are flying around... AdjustWindowRectEx seemed appropriate and according to PlatformSDK, it's exactly what I was looking for... Thanks much... ;-)) Maybe I should spy on Word... could learn a lot from it... This message was edited by Shawn Bullock, on 3/20/2001 12:31:52 PM
Posted on 2001-03-20 11:28:00 by _Shawn
I take that back, that wasn't the answer... AdjustWindowRect isn't changing the client area of an MDI ... _Shawn
Posted on 2001-03-20 11:39:00 by _Shawn