My dialog will not close here is the msg handler and the resource.
Code:
// FUNCTIONS //////////////////////////////////////////////
BOOL CALLBACK PeerToPeerDialogProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
switch (msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch( LOWORD(wparam) )
{
case IDOK:
break;
case IDCANCEL:
EndDialog( hDlg, 0 );
return TRUE;
}
break;
}
return FALSE;
}
Excerpt from the resource:
Code:
IDD_DIALOGPEERTOPEER DIALOG DISCARDABLE 0, 0, 356, 196
STYLE WS_CHILD | WS_CAPTION
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Peer to Peer Connection Dialog",IDC_STATIC,126,4,100,8
LTEXT "Resource Dialog Test",IDC_STATIC,25,20,73,12
DEFPUSHBUTTON "Button1",IDCANCEL,255,140,70,15
END
Finally the call to the dialog
Code:
if (KEY_DOWN(VK_BACK) || keyboard_state[DIK_BACK])
{
//ShowWindow(main_window_handle, SW_HIDE);
DialogBox(main_instance,MAKEINTRESOURCE(IDD_DIALOGPEERTOPEER),main_window_handle,PeerToPeerDialogProc);
//ShowWindow(main_window_handle, SW_SHOW);
}