Getting user input from dialog boxes

Started by
1 comment, last by AbsolutDew 22 years, 2 months ago
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?
Advertisement
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.
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.

thanks for reply though

This topic is closed to new replies.

Advertisement