1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
struct MyDialogData { }; BOOL CALLBACK MyDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static MyDialogData* spData; switch(uMsg) { case WM_INITDIALOG: { spData = (MyDialogData*)lParam; return TRUE; } break; case WM_COMMAND: { switch(LOWORD(wParam)) { case IDOK: { EndDialog(hDlg, IDOK); return 0; } break; case IDCANCEL: { EndDialog(hDlg, IDCANCEL); return 0; } break; } break; } break; } return FALSE; } ..... MyDialogData data; if(IDOK != DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG_ASK), NULL, MyDlgProc, (LPARAM)&data)) { return 100; } ..... |