一般来说模态对话框都是调用 CDialog::EndDialog(int);结束的 模板生成的OnOK();和OnCancel();分别对应EndDialog(IDOK);和EndDialog(IDCANCEL); 以下是一般对话框的结束码定义,对应的含义看其英文就行了。 #define IDOK 1 #define IDCANCEL 2 #define IDABORT 3 #define IDRETRY 4 #define IDIGNORE 5 #define IDYES 6 #define IDNO 7 #if(WINVER >= 0x0400) #define IDCLOSE 8 #define IDHELP 9 #endif /* WINVER >= 0x0400 */ 你也可以自己定义结束码,然后由调用对话框的函数去判断结果。