| 539 | } |
| 540 | |
| 541 | LRESULT CServiceTable::OnServiceContinue(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { |
| 542 | int selected = m_Table.data.selected; |
| 543 | ATLASSERT(selected >= 0); |
| 544 | auto& svc = m_Table.data.info[selected]; |
| 545 | |
| 546 | ATLASSERT(svc.GetStatusProcess().CurrentState == ServiceState::Paused); |
| 547 | |
| 548 | auto service = Service::Open(svc.GetName(), ServiceAccessMask::PauseContinue | ServiceAccessMask::QueryStatus); |
| 549 | if (service == nullptr) { |
| 550 | AtlMessageBox(*this, L"Failed to open service", IDS_TITLE, MB_ICONERROR); |
| 551 | return 0; |
| 552 | } |
| 553 | |
| 554 | if (!service->Continue()) { |
| 555 | AtlMessageBox(*this, L"Failed to resume service", IDS_TITLE, MB_ICONERROR); |
| 556 | return 0; |
| 557 | } |
| 558 | |
| 559 | CProgressDlg dlg; |
| 560 | dlg.ShowCancelButton(false); |
| 561 | dlg.SetMessageText((L"Resuming service " + svc.GetName() + L"...").c_str()); |
| 562 | dlg.SetProgressMarquee(true); |
| 563 | dlg.SetTimerCallback([&]() { |
| 564 | service->Refresh(svc); |
| 565 | if (svc.GetStatusProcess().CurrentState == ServiceState::Running) |
| 566 | dlg.Close(); |
| 567 | }, 500); |
| 568 | dlg.DoModal(); |
| 569 | |
| 570 | return 0; |
| 571 | } |
| 572 | |
| 573 | LRESULT CServiceTable::OnServiceProperties(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { |
| 574 | int selected = m_Table.data.selected; |
nothing calls this directly
no test coverage detected