I’m new to win32api programming. I would like to know how to create a dialog box within a non-gui program (without any resource created).
I’ve seen some examples with that CreateIndirect function. Is it the best method? Any other way?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You would use DialogBoxIndirectParam or CreateDialogIndirectParam
With these functions, its a bit more work, but it’s possible to imbed a simple dialog template as an initialized static struct in your code. The format of a dialog template has some inplace variable sized arrays, so you have to have a struct declaration that is specific to a particular dialog, but this works OK for debug code.
Something like this
A more sophisticated solution would be to build up a dialog template structure in memory, but this works well for debug code where the dialog itself doesn’t change much.