Block ESC and Enter keys in modeless dialog box (Win32, non-MFC)
问题 There're some articles written on this subject, but none of them worked in my case. I'm writing the following using Win32 (no MFC). The goal is to prevent ESC or ENTER keys from closing the modeless dialog box. Here's the dialog template: IDD_DIALOG_1 DIALOGEX 0, 0, 345, 179 STYLE DS_SETFONT | DS_FIXEDSYS | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL "New Pt",IDC_CHECK_NEW_PT,"Button",BS_AUTOCHECKBOX | BS