   getting the value from a textbox on a modal dialog
  I am using the following code to create a dialog box:int hWndDialog = DialogBox((HINSTANCE)GetWindowLong(hwnd,GWL_HINSTANCE), MAKEINTRESOURCE(DLGBet), hwnd, (DLGPROC) DlgProc); On it, I have a text box that I need to retrieve the value from. The dialog box displays properly and is, in fact, modal. The problem is that I can't get at the value that the player has entered. Could someone help please?Thanks.EDIT - I just realized that the second time the dialog box is created, it does not even show. It's as though it's no longer modal and the program blows right past it.[Edited by - vinb on December 8, 2005 3:57:21 PM]
  First, the return value of DialogBox() isn't an HWND, it's the value specified in the EndDialog() call.For an example of how to use DialogBox() and get text from an edit control on said dialog, look here. The second example under "Creating a Modal Dialog Box" shows how to do what you want.Without seeing your code, I can't say why you are having a problem displaying the dialog a second time.;  Thanks for your help. I actually read this tutorial twice before posting. I didn't notice the 'Show Example' part. Goes to show I should read a little more carefully. I fixed the 'second showing' problem by simulating modality with a while{} loop before redrawing the screen. What confuses me is why this is necessary. Shouldn't processing stop if a dialog box (or any form for that mater) is displayed modally? In any case, this is really starting to look cool. Not a whole lot going on at work (again) today so I've got lots of time to work on it!   