Help! Want to make a dynamic modal dialog box.

Help! Want to make a dynamic modal dialog box.

Post by Mukun » Mon, 27 Feb 1995 16:49:27



Hi,

    I am writing a Windows application using Borland C/C++ compiler(ver 3.1).
At a particular point in my program I want to create a dynamic modal dialog
box. Depending upon a particular parameter input by the user I want to
create a certain no. of CheckBoxes in the dialog box. This dialog box has to
be created from another dialog box and not from the main window. As I cannot
use the .rc file to create the dialog box, I am stumped as what to do.
Could'nt find the solution elsewhere so I am posting the question.

I would appreciate if someone could guide me to the same.
                                      Thanking you,
                                                       Mukund.

 
 
 

Help! Want to make a dynamic modal dialog box.

Post by John Gra » Tue, 28 Feb 1995 01:48:17



>Hi,

>    I am writing a Windows application using Borland C/C++ compiler(ver 3.1).
>At a particular point in my program I want to create a dynamic modal dialog
>box. Depending upon a particular parameter input by the user I want to
>create a certain no. of CheckBoxes in the dialog box. This dialog box has to
>be created from another dialog box and not from the main window. As I cannot
>use the .rc file to create the dialog box, I am stumped as what to do.
>Could'nt find the solution elsewhere so I am posting the question.

>I would appreciate if someone could guide me to the same.
>                                      Thanking you,
>                                                       Mukund.


        Look at DialogBoxIndirect().  It's definitely not as simple as using
        a resource.  Another possible method is to create all of the buttons
        in a simple dialog resource, but only enable & show those that you
        need.  This may or may not be a simple solution, depending on the
        complexity of your buttons.
--

Airborne Geophysics
Geological Survey of Canada, Ottawa

 
 
 

Help! Want to make a dynamic modal dialog box.

Post by R.A. Hein » Tue, 28 Feb 1995 04:10:08


>>    I am writing a Windows application using Borland C/C++ compiler(ver 3.1).
>>At a particular point in my program I want to create a dynamic modal dialog
>>box. Depending upon a particular parameter input by the user I want to
>>create a certain no. of CheckBoxes in the dialog box. This dialog box has to
>>be created from another dialog box and not from the main window. As I cannot
>>use the .rc file to create the dialog box, I am stumped as what to do.
>>Could'nt find the solution elsewhere so I am posting the question.

>>I would appreciate if someone could guide me to the same.

>    Look at DialogBoxIndirect().  It's definitely not as simple as using
>    a resource.  Another possible method is to create all of the buttons
>    in a simple dialog resource, but only enable & show those that you
>    need.  This may or may not be a simple solution, depending on the
>    complexity of your buttons.
>--

>Airborne Geophysics
>Geological Survey of Canada, Ottawa

Another method would be to create a mostly empty dialog resource, then
use CreateWindow to make the necessary buttons in your WM_INITDIALOG
handler.  I presume you'd also want to resize it to fit the variable
number of buttons.  Of course, by the time you do all this it may be
easier to just use DialogBoxIndirect, as John suggests.

--Ray Heindl

 
 
 

Help! Want to make a dynamic modal dialog box.

Post by Jason Cla » Tue, 28 Feb 1995 06:14:42



>Hi,

>    I am writing a Windows application using Borland C/C++ compiler(ver 3.1).
>At a particular point in my program I want to create a dynamic modal dialog
>box. Depending upon a particular parameter input by the user I want to
>create a certain no. of CheckBoxes in the dialog box. This dialog box has to
>be created from another dialog box and not from the main window. As I cannot
>use the .rc file to create the dialog box, I am stumped as what to do.
>Could'nt find the solution elsewhere so I am posting the question.

I am not completely sure I understand the question, however it sounds to me
like you could create a dialog that has the maximum number of controls that
you would ever need in the "dynamic" dialog, but DO NOT make them visible.
Then programatically show each dialog control that you need so that it is not
hidden.  This would give the effect of dynamically deciding how many controls
are in a dialog.

Jason Clark

 
 
 

Help! Want to make a dynamic modal dialog box.

Post by Robert Mashl » Tue, 28 Feb 1995 03:25:06



Quote:

>Hi,

>    I am writing a Windows application using Borland C/C++ compiler(ver 3.1).
>At a particular point in my program I want to create a dynamic modal dialog
>box. Depending upon a particular parameter input by the user I want to
>create a certain no. of CheckBoxes in the dialog box. This dialog box has to
>be created from another dialog box and not from the main window. As I cannot
>use the .rc file to create the dialog box, I am stumped as what to do.
>Could'nt find the solution elsewhere so I am posting the question.

See the DialogBoxIndirect() function.

--


Resources for Windows Developers
http://www.csn.net/~rmashlan/windev/windev.html

 
 
 

Help! Want to make a dynamic modal dialog box.

Post by Charlie Gib » Wed, 01 Mar 1995 08:43:04


In article


>Hi,

>    I am writing a Windows application using Borland C/C++ compiler
>(ver 3.1). At a particular point in my program I want to create a
>dynamic modal dialog box. Depending upon a particular parameter input
>by the user I want to create a certain no. of CheckBoxes in the dialog
>box. This dialog box has to be created from another dialog box and not
>from the main window. As I cannot use the .rc file to create the dialog
>box, I am stumped as what to do. Could'nt find the solution elsewhere
>so I am posting the question.

>I would appreciate if someone could guide me to the same.

I was faced with a similar problem.  I've written a general-purpose
screen handler for MS-DOS.  It takes a pointer to an array of
structures describing fields the user can fill in (length, type,
position on screen, etc.).  Because my program had to have access
to this information, and possibly modify it dynamically (like you
want), a normal dialog box, whose .RC file is outside the program
and therefore inaccessible, was out.  I solved the problem the hard
way - the Windows version of my routine opens a window of its own
and then opens a series of child controls in it according to the
specification table.  You'll probably have to subclass the edit
controls to handle tabbing, etc.  It's a bit more complex, but
retains the flexibility and portability that I need.  Best of all,
it's a piece of code that I wrote once and can re-use anywhere.


MS-DOS: I hate it, but I use it - twice a day.

 
 
 

1. Making Modal Dialog boxes invisible

I have a program that I use SetWindowsHookEx to hook an application so I can
emulate user activity (key clicks, mouse clicks etc.) to it. What I want to
do is not show any dialog boxes that the application may pop-up. I just want
to process them.

The question is what do I look for to prevent the dialog box to appear?
Would I look for WM_CREATE and make sure the WS_VISIBLE flag is not set or
is there something different when it comes to dialog boxes?

2. FASTEST operating system in America!!!

3. Calling a modeless dialog box from a modal dialog box

4. LOW RATES PLUS ONE FREE WEEK OF LD

5. Help! Modal dialog opening modal dialog = problem

6. Utility to NFS export in Warp4

7. Modeless dialog out of a Modal dialog box: possible?

8. TranswarpGS & GS/OS 6.0.1

9. modal dialog child of modal dialog?

10. Help : Non modal dialogue box can't be seen

11. HELP! Dialog Boxes within Dialog Boxes!

12. Help - Dynamic text in field descriptions for Dialog boxes

13. Help with dynamic dialog box