MessageBox loses focus on Smartphone and reboot is needed

Hi everybody,

I use ATL and Visual Studio 2005.
I create an EDIT BOX like this:

hWndchoice1 = CreateWindow(_T("EDIT"),

Prefs.DataPerPerson[num].PlayerName, WS_VISIBLE | WS_TABSTOP |

WS_BORDER, SCALEX(80), SCALEY(44), SCALEX(140), SCALEY(22), hWnd,

(HMENU)IDC_EDIT_BOX1, g_hInst, 0);



Then I want the user to be able to write with the Smartphone keys so I give it focus like this:

SetFocus(hWndchoice1);


It works ok but after that when I try to show an input message box to exit the game like that:

if

(MessageBox(hWnd, _T("Do you want to exit the program?"), _T("Exit the

program?"), MB_ICONWARNING | MB_YESNO | MB_APPLMODAL) == IDYES)
{
//exit the game
}



The

focus is not on the message box and the program stucks. You cant chose

either yer or no. You have to soft reset the Smartphone in order to

continue. Also this message box doesnt appear right. It is missing the

bar on top. All the other message is correct except the bar on top.

What am I doing wrong? How can I fix this problem.
Thanks for your help, I'm really stuck with that.

Giorgos Sarris

[3827 byte] By [giorgos_gs] at [2007-12-24]