Sign in to follow this  
valles

Direct X9 and dialog boxes

Recommended Posts

valles    173
I need an example of DXUT used with dialog boxes or someone to correct my code. The new DirectX 9 and DXUT don't have examples of dialog boxes with Direct3d, instead they are all showing the new built in gui they provide. I would like to use the old gui with my system, but can't find any examples. The dialog box I made won't even display until I placed the switch for WM_PAINT in the function. Now it displays, but isn't accepting any mouse input to operate any of the buttons. Here is the code:
LRESULT CALLBACK Picker(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	HDC hdc;
	PAINTSTRUCT ps;
	switch (message)
	{
		case WM_COMMAND:
			switch( LOWORD(wParam) )
			{
				case IDC_OK:

					break;
				case IDC_CANCEL:
					EndDialog(hDlg, LOWORD(wParam));
					return TRUE;
					break;
			}
			break;

		case WM_PAINT:
			hdc = BeginPaint(hDlg, &ps);
			// TODO: Add any drawing code here...
			EndPaint(hDlg, &ps);
			break;
	}
    return FALSE;
}


this is what is called inside of MsgProc, using the mouse wheel activates my call, the messagebox runs fine, but my dialogbox doesn't:
		case WM_MOUSEWHEEL:
			MessageBox(NULL,L"createdialog", L"HAHA2", MB_OK);
			DialogBox(NULL, (LPCTSTR)IDD_PICKER, hWnd, (DLGPROC)Picker);
			break;


Here are the two pics I have, the first is of what a dialog box should look like, and the second is what my dialog box looks like. pic1
pic2
Any examples or help is appreciated. - Valles

Share this post


Link to post
Share on other sites
Mike2343    1202
Also, keyboard is working? You can tab to the buttons and select ok/cancel?

Edit: I would also try removing the LOWORD(wParam) part and have just it as wParam. That's what I do and my dialogs work fine.

Share this post


Link to post
Share on other sites
valles    173
Removing LOWORD does not work, and tab does not work, windows does the thing where it beeps at me when I try to do something that is not accessible. I will try to find out about these child windows and keep hacking at it until I find a solution.

Apparently there's a whole document on DXUT that explains how to customize it, I'll have to get into depth learning all about DXUT and how MFC works with popups and child windows in order to solve this problem.

- Valles

[Edited by - valles on November 29, 2005 9:07:48 PM]

Share this post


Link to post
Share on other sites
valles    173
ARGH!!! I FINALLY GOT IT! Okay, so from VC++ in "Resource View" I doubleclick on my dialog resource, then right click the on the dialog box labeled "TODO: Place dialog controls here", then properties, style and set that to either popup or overlapped.

I went through the trouble of creating DirectX9 code that utilizes DXUT with my own MainLoop. I'll create an article for gamedev as soon as I get a chance, in the mean time if anyone is having a problem with that section of code, go ahead and email me valles_mar@hotmail.com with the subject "DXUT".

Thanks everyone

- Valles

[Edited by - valles on November 30, 2005 12:22:20 PM]

Share this post


Link to post
Share on other sites

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