| 116 | } |
| 117 | |
| 118 | INT_PTR StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { |
| 119 | switch (message) { |
| 120 | case WM_INITDIALOG: { |
| 121 | StaticDialog *pStaticDlg = (StaticDialog *)(lParam); |
| 122 | pStaticDlg->_hSelf = hwnd; |
| 123 | ::SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam); |
| 124 | ::GetWindowRect(hwnd, &(pStaticDlg->_rc)); |
| 125 | pStaticDlg->run_dlg_proc(message, wParam, lParam); |
| 126 | |
| 127 | return TRUE; |
| 128 | } |
| 129 | |
| 130 | default: { |
| 131 | StaticDialog *pStaticDlg = reinterpret_cast<StaticDialog *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); |
| 132 | if (!pStaticDlg) |
| 133 | return FALSE; |
| 134 | for (auto &weak_control : pStaticDlg->m_controls) { |
| 135 | if (auto control = weak_control.lock()) { |
| 136 | switch (control->dlg_proc(message, wParam, lParam)) { |
| 137 | case DlgProcResult::processed: |
| 138 | return TRUE; |
| 139 | case DlgProcResult::pass_through: |
| 140 | break; |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | return pStaticDlg->run_dlg_proc(message, wParam, lParam); |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT &point) { |
| 150 | RECT rc, rc2; |
nothing calls this directly
no test coverage detected