MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / OnServiceContinue

Method OnServiceContinue

WinArk/ServiceTable.cpp:541–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541LRESULT 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
573LRESULT CServiceTable::OnServiceProperties(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
574 int selected = m_Table.data.selected;

Callers

nothing calls this directly

Calls 8

GetNameMethod · 0.80
ShowCancelButtonMethod · 0.80
SetMessageTextMethod · 0.80
SetProgressMarqueeMethod · 0.80
SetTimerCallbackMethod · 0.80
ContinueMethod · 0.45
RefreshMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected