| 95 | } |
| 96 | |
| 97 | void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) { |
| 98 | if (isRTL) { |
| 99 | DLGTEMPLATE *pMyDlgTemplate = NULL; |
| 100 | HGLOBAL hMyDlgTemplate = makeRTLResource(dialogID, &pMyDlgTemplate); |
| 101 | _hSelf = ::CreateDialogIndirectParam(_hInst, pMyDlgTemplate, _hParent, dlgProc, (LPARAM)this); |
| 102 | ::GlobalFree(hMyDlgTemplate); |
| 103 | } else |
| 104 | _hSelf = ::CreateDialogParam(_hInst, MAKEINTRESOURCE(dialogID), _hParent, dlgProc, (LPARAM)this); |
| 105 | |
| 106 | if (!_hSelf) { |
| 107 | DWORD err = ::GetLastError(); |
| 108 | char errMsg[256]; |
| 109 | sprintf(errMsg, "CreateDialogParam() return NULL.\rGetLastError() == %lu", err); |
| 110 | ::MessageBoxA(NULL, errMsg, "In StaticDialog::create()", MB_OK); |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent |
| 115 | ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, (WPARAM)_hSelf); |
| 116 | } |
| 117 | |
| 118 | INT_PTR StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { |
| 119 | switch (message) { |