• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Getting user input from dialog boxes

## Recommended Posts

Hi, i''m trying to create a dialog box to get an ip adress to join a game from the player, and it''s turning out to be harder then i thought. I set up a message pump like this
  //----------------------------------------------------------------------------- // Name: DlgProc() // Desc: Handles dialog messages //----------------------------------------------------------------------------- INT_PTR CALLBACK DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) { switch ( msg ) { case WM_INITDIALOG: SetWindowText( hDlg, WINDOW_NAME ); break; case WM_COMMAND: switch ( LOWORD( wParam ) ) { case IDCANCEL: EndDialog( hDlg, 0 ); return TRUE; } break; } return FALSE; } 
and i call the DialogBox function in WinMain after all the direct X initialization etc.
  DialogBox( hInst, MAKEINTRESOURCE( IDD_GET_HOST_IP ), hWnd, (DLGPROC) DlgProc ); 
Anyways it compiles with no errors, but when it gets to the dialog box line nothing happens, it just skips over it with no popup. What am i missing?

##### Share on other sites
It looks fine, but you say that you are trying to display it after initializing DX. Are you using a fullscreen window? If you are that could be the problem, because I''m pretty sure you can''t just display GDI stuff over a fullscreen DX app.

##### Share on other sites
Actually for debugging, im running in windowed mode right now.

I just tried moving the dialog box call to right after my WinInit function (before dx initilization stuff) and still nothing.

• ### Forum Statistics

• Total Topics
627736
• Total Posts
2978868

• 10
• 10
• 21
• 14
• 12