| 26 | } |
| 27 | |
| 28 | INT_PTR CALLBACK BaseDialogProcStub(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 29 | { |
| 30 | switch (uMsg) |
| 31 | { |
| 32 | case WM_INITDIALOG: |
| 33 | { |
| 34 | /* Store a mapping between window handles |
| 35 | and objects. This must be done, as each |
| 36 | dialog is managed by a separate object, |
| 37 | but all window calls come through this |
| 38 | function. |
| 39 | Since two or more dialogs may be |
| 40 | shown at once (as a dialog can be |
| 41 | modeless), this function needs to be able |
| 42 | to send the specified messages to the |
| 43 | correct object. |
| 44 | May also use thunks - see |
| 45 | http://www.hackcraft.net/cpp/windowsThunk/ */ |
| 46 | g_windowMap.insert(std::unordered_map<HWND, BaseDialog *>::value_type( |
| 47 | hDlg, reinterpret_cast<BaseDialog *>(lParam))); |
| 48 | } |
| 49 | break; |
| 50 | } |
| 51 | |
| 52 | auto itr = g_windowMap.find(hDlg); |
| 53 | |
| 54 | if (itr != g_windowMap.end()) |
| 55 | { |
| 56 | return itr->second->BaseDialogProc(hDlg, uMsg, wParam, lParam); |
| 57 | } |
| 58 | |
| 59 | return 0; |
| 60 | } |
| 61 | |
| 62 | INT_PTR CALLBACK BaseDialog::BaseDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 63 | { |
nothing calls this directly
no test coverage detected