Sign in to follow this  

Win32 - Dialog spawned from another dialog?

This topic is 3856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The Windows API is not something I specialize in... Firstly, I'm not sure if this is the BEST way to go about solving this problem. So if you think of a better way, please don't hesitate to suggest it. This is a tower defense game editor I'm working on. Basically, I have a dialog.. the dialog, as a whole, edits a tower from the game. The dialog has a listbox in it, which is a list of other towers that the tower can upgrade to, and I have a button to "Add [an] Existing Tower" to the list. So, when the user clicks the button, a little message box or something should pop up, asking them which tower the user wants to add to the list of upgrades. I know not a lot about the Win32 API, but I thought the best way to implement this would be to maybe have a small dialog box pop up, and that dialog box would have a dropdown list of existing towers in it. The user chooses a tower from that list, and clicks the OK button, and the focus goes back to the main tower-editing dialog, where the selected tower has been added to the list of possible upgrades. To do that.. is there a way to spawn a dialog and have that dialog return a value? I.e., the selection mini-dialog pops up, the user selects a tower and clicks OK, and the mini-dialog "returns" the name of that tower to the main editing dialog. Bottom line/question: How would I implement this, or is there a better way to implement this that I've overlooked? I'm guessing there probably is.

Share this post


Link to post
Share on other sites
So EndDialog() lets to specify the return value, and then the function used to create the dialog, DialogBox(), receives that value as a return value?

edit: Oops, I should have read the page more closely-- but yep, that's what it says there. Cool, thanks for the help. :)

Share this post


Link to post
Share on other sites

This topic is 3856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this