| 62 | } |
| 63 | |
| 64 | INT_PTR CALLBACK ProgressDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
| 65 | { |
| 66 | switch(message) |
| 67 | { |
| 68 | case WM_INITDIALOG: |
| 69 | { |
| 70 | ::SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam); |
| 71 | ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(lParam); |
| 72 | return dlg->runDlgProc(hWnd, message, wParam, lParam); |
| 73 | } |
| 74 | |
| 75 | case WM_COMMAND: |
| 76 | { |
| 77 | if (IDCANCEL == wParam) { |
| 78 | int mbResult = MessageBox(hWnd, _T("Are you sure you wish to abort the current installation/removal?"), _T("Cancel installation / removal?"), MB_YESNO | MB_ICONQUESTION); |
| 79 | if (IDYES == mbResult) { |
| 80 | ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); |
| 81 | dlg->_cancelToken.triggerCancel(); |
| 82 | } |
| 83 | } |
| 84 | return FALSE; |
| 85 | } |
| 86 | default: |
| 87 | { |
| 88 | ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); |
| 89 | return dlg->runDlgProc(hWnd, message, wParam, lParam); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | } |
| 94 | |
| 95 | void ProgressDialog::goToCenter() |
| 96 | { |
nothing calls this directly
no test coverage detected