Win32 - Dialog spawned from another dialog?

Started by
1 comment, last by josh1billion 16 years, 10 months ago
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.
Website (with downloads of my games)
Blog (updates on current projects)
Seeds of Time Online has returned!
Advertisement
The EndDialog() function returns any value you want. Clicky
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. :)
Website (with downloads of my games)
Blog (updates on current projects)
Seeds of Time Online has returned!

This topic is closed to new replies.

Advertisement