| 139 | } |
| 140 | |
| 141 | void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) |
| 142 | { |
| 143 | if (isRTL) |
| 144 | { |
| 145 | DLGTEMPLATE *pMyDlgTemplate = NULL; |
| 146 | HGLOBAL hMyDlgTemplate = makeRTLResource(dialogID, &pMyDlgTemplate); |
| 147 | _hSelf = ::CreateDialogIndirectParam(_hInst, pMyDlgTemplate, _hParent, dlgProc, reinterpret_cast<LPARAM>(this)); |
| 148 | ::GlobalFree(hMyDlgTemplate); |
| 149 | } |
| 150 | else |
| 151 | _hSelf = ::CreateDialogParam(_hInst, MAKEINTRESOURCE(dialogID), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)); |
| 152 | |
| 153 | if (!_hSelf) |
| 154 | { |
| 155 | DWORD err = ::GetLastError(); |
| 156 | char errMsg[256]; |
| 157 | sprintf(errMsg, "CreateDialogParam() return NULL.\rGetLastError() == %u", err); |
| 158 | ::MessageBoxA(NULL, errMsg, "In StaticDialog::create()", MB_OK); |
| 159 | return; |
| 160 | } |
| 161 | |
| 162 | // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent |
| 163 | ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast<WPARAM>(_hSelf)); |
| 164 | } |
| 165 | |
| 166 | INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| 167 | { |
no outgoing calls
no test coverage detected