Dialog box generation at run time

Dialog box generation at run time

I would like to generate a dialog box during program execution rather
than use the dialog editor method as is possible for menus.
I would expect that a call to DlgInit would be replaced by a series of calls
to set up the dialog structure for each control.
Is this possible?. Is it easy to do? If so how?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Well, I wouldn't call it "easy to do". I think it's doable, but it's questionnable whether it's worth the effort. I use DFLOGM (ok, XFLOGM) for my main GUI project for some 40 dialogs, while some 5-6, where I need something special, are managed using Win32 API. DialogBox API and family (DialogProc, WM_COMMAND, GetDlgItem) is compatible with any kind of application. It's not that hard to program; I believe there are samples on CVF CD for dialog-based applications.

Besides, relatively simple stuff (such as variable but limited number of controls) can still be handled with DFLOGM so that you create a dialog resource with maximal number of controls, assign them subsequent ID numbers (say, from 1100 to 1100+n -- that's not mandatory, just for easier handling using DO-loops) and use ShowWindow/GetDlgItem and/or MoveWindow from the code to modify the number at run-time.


Jugoslav www.xeffort.com

Leave a Comment

Please sign in to add a comment. Not a member? Join today