@@ -84,7 +84,7 @@ void JsonViewDlg::FormatJson()
8484 // Intimate user
8585 std::string err = std::format (" \n\n Error: ({} : {})" , res.error_code , res.error_str );
8686
87- ::MessageBox (m_NppData._nppHandle , (JSON_ERR_VALIDATE + StringHelper::ToWstring(err)).c_str(), JSON_ERROR_TITLE , MB_OK | MB_ICONERROR);
87+ ShowMessage (JSON_ERROR_TITLE , (JSON_ERR_VALIDATE + StringHelper::ToWstring (err)).c_str (), MB_OK | MB_ICONERROR);
8888 }
8989}
9090
@@ -109,7 +109,7 @@ void JsonViewDlg::CompressJson()
109109 // Intimate user
110110 std::string err = std::format (" \n\n Error: ({} : {})" , res.error_code , res.error_str );
111111
112- ::MessageBox (m_NppData._nppHandle , (JSON_ERR_VALIDATE + StringHelper::ToWstring(err)).c_str(), JSON_ERROR_TITLE , MB_OK | MB_ICONERROR);
112+ ShowMessage (JSON_ERROR_TITLE , (JSON_ERR_VALIDATE + StringHelper::ToWstring (err)).c_str (), MB_OK | MB_ICONERROR);
113113 }
114114}
115115
@@ -139,7 +139,7 @@ void JsonViewDlg::ValidateJson()
139139
140140 if (res.success )
141141 {
142- ::MessageBox (m_NppData._nppHandle , JSON_ERR_VALIDATE_SUCCESS, JSON_INFO_TITLE , MB_OK | MB_ICONINFORMATION);
142+ ShowMessage (JSON_INFO_TITLE , JSON_ERR_VALIDATE_SUCCESS, MB_OK | MB_ICONINFORMATION);
143143 }
144144 else
145145 {
@@ -151,7 +151,7 @@ void JsonViewDlg::ValidateJson()
151151 // Intimate user
152152 std::string err = std::format (" \n\n Error: ({} : {})" , res.error_code , res.error_str );
153153
154- ::MessageBox (m_NppData._nppHandle , (JSON_ERR_VALIDATE + StringHelper::ToWstring(err)).c_str(), JSON_ERROR_TITLE , MB_OK | MB_ICONERROR);
154+ ShowMessage (JSON_ERROR_TITLE , (JSON_ERR_VALIDATE + StringHelper::ToWstring (err)).c_str (), MB_OK | MB_ICONERROR);
155155 }
156156}
157157
@@ -314,12 +314,12 @@ void JsonViewDlg::PopulateTreeUsingSax(HTREEITEM tree_root, const std::string &j
314314 // Intimate user
315315 if (jsonText.empty ())
316316 {
317- ::MessageBox (m_NppData._nppHandle , JSON_ERR_PARSE, JSON_ERROR_TITLE , MB_OK | MB_ICONERROR);
317+ ShowMessage (JSON_ERROR_TITLE , JSON_ERR_PARSE, MB_OK | MB_ICONERROR);
318318 }
319319 else
320320 {
321321 std::string err = std::format (" \n\n Error: ({} : {})" , res.error_code , res.error_str );
322- ::MessageBox (m_NppData._nppHandle , (JSON_ERR_VALIDATE + StringHelper::ToWstring(err)).c_str(), JSON_ERROR_TITLE , MB_OK | MB_ICONERROR);
322+ ShowMessage (JSON_ERROR_TITLE , (JSON_ERR_VALIDATE + StringHelper::ToWstring (err)).c_str (), MB_OK | MB_ICONERROR);
323323 }
324324 }
325325
@@ -492,9 +492,9 @@ auto JsonViewDlg::CopyPath() const -> std::wstring
492492 return std::wstring ();
493493}
494494
495- int JsonViewDlg::ShowMessage (const std::wstring& title, const std::wstring& msg, int flag, bool bForceShow )
495+ int JsonViewDlg::ShowMessage (const std::wstring & title, const std::wstring & msg, int flag, bool bDontShow )
496496{
497- return bForceShow ? ::MessageBox (_hParent, msg.c_str (), title.c_str (), flag) : IDOK;
497+ return !bDontShow ? ::MessageBox (_hParent, msg.c_str (), title.c_str (), flag) : IDOK;
498498}
499499
500500void JsonViewDlg::ToggleMenuItemState (bool bVisible)
@@ -651,7 +651,7 @@ INT_PTR JsonViewDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
651651 break ;
652652
653653 case IDC_BTN_SEARCH:
654- MessageBox (_hSelf, L" IDC_BTN_SEARCH " , L" OK " , MB_OK);
654+ ShowMessage ( L" OK " , L" IDC_BTN_SEARCH " , MB_OK);
655655 break ;
656656
657657 // context menu entries
0 commit comments