Dialogue box button not responding

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Dialogue box is displayed with a button but the button will respond to clicks and later dialogue window goes unresponsive[background=#fafafa]I created dialogue box using resource wizard,[/background]
[background=#fafafa]code in Resource.rc for dialogue box is generated as below[/background]
[background=#fafafa]

Code:IDD_DIALOG1 DIALOGEX 0, 0, 131, 69
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Test dialogue"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "That is Good",IDOK,30,35,66,25
LTEXT "Test is successful .",IDC_STATIC,33,15,75,11
END[/background]
[background=#fafafa]Dialogue box is associated with a menu item by the code[/background]

[background=#fafafa]

Code:case IDM_ABOUT:
CreateDialog(hInst, MAKEINTRESOURCE(IDD_DIALOG1),hwindp, Dialog1Proc);
return 0;
break;[/background]
[background=#fafafa]message processor for the dialogue box is as below[/background]

[background=#fafafa]

Code:INT_PTR CALLBACK Dialog1Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{

switch(message)
{ case WM_INITDIALOG:
return (INT_PTR)TRUE;
return a;
break;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;

// return (INT_PTR) TRUE;
}


return (INT_PTR) FALSE;

}[/background]
[background=#fafafa]Adding a case statement IDOK did not help[/background]

[background=#fafafa]

Code:case IDOK:
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;[/background]
[background=#fafafa]I really need some help at this point, i will be glad if i can get help now.[/background]

View the full article
 
Back
Top