You need to process menu commands. In this application, instead of performing tasks, all menu commands activate a “Command not implemented” message box. Replace the WM_COMMAND case with the following statements:
case WM_COMMAND:
switch (wParam) {
case IDM_ABOUT:
lpProcAbout = MakeProcInstance(About, hInst);
DialogBox(hInst, “AboutBox”, hWnd, lpProcAbout);
FreeProcInstance(lpProcAbout);
break;
/* file menu commands */
case IDM_NEW:
case IDM_OPEN:
case IDM_SAVE:
case IDM_SAVEAS:
case IDM_PRINT:
MessageBox (
GetFocus(),
“Command not implemented”,
“EditMenu Sample Application”,
MB_ICONASTERISK | MB_OK);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
/* edit menu commands */
case IDM_UNDO:
case IDM_CUT:
case IDM_COPY:
case IDM_PASTE:
case IDM_CLEAR:
MessageBox (
GetFocus(),
“Command not implemented”,
“EditMenu Sample Application”,
MB_ICONASTERISK | MB_OK);
break;
}
break;