| 329 | } |
| 330 | |
| 331 | LRESULT CMainFrameWnd::OnUpdate(HWND hwnd, WPARAM wParam, LPARAM lParam) |
| 332 | { |
| 333 | std::string *data = (std::string*) (wParam); |
| 334 | StringStream ss(data->c_str()); |
| 335 | Document document; |
| 336 | if (document.ParseStream<0>(ss).HasParseError()) |
| 337 | { |
| 338 | delete data; |
| 339 | return TRUE; |
| 340 | } |
| 341 | bool needNotice = false; |
| 342 | if (document.HasMember("Notice")) |
| 343 | { |
| 344 | needNotice = document["Notice"].GetBool(); |
| 345 | } |
| 346 | if (needNotice) |
| 347 | { |
| 348 | std::string version; |
| 349 | if (document.HasMember("Version")) |
| 350 | { |
| 351 | version = document["Version"].GetString(); |
| 352 | } |
| 353 | if (version > VERSION) |
| 354 | { |
| 355 | UserMessageBox(GetHWND(), 20000, Base::CharacterSet::ANSIToUnicode(version).c_str(), MB_ICONINFORMATION); |
| 356 | //::ShellExecute(NULL, NULL, _T("https://github.com/cinience/RedisStudio/releases"), NULL, NULL, NULL); |
| 357 | } |
| 358 | } |
| 359 | delete data; |
| 360 | return TRUE; |
| 361 | } |
| 362 | |
| 363 | DWORD WINAPI CMainFrameWnd::BackgroundWork( LPVOID lpParameter ) |
| 364 | { |
nothing calls this directly
no test coverage detected