#include <windows.h>
#include <tlhelp32.h>
#include <iostream>
using namespace std;
// 控制极域服务状态
bool ControlClassService(bool enable) {
SC_HANDLE scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (!scm) return false;
}
// 主控制台界面
void ShowControlPanel() {
system("cls");
cout << "=== 极域电子教室控制面板 ===" << endl;
cout << "当前状态: " << (ControlClassService(true) ? "已连接" : "已断开") << endl;
cout << "--------------------------" << endl;
cout << "按 0 临时脱控(仍可收文件)" << endl;
cout << "按 1 重新连接教师端" << endl;
cout << "按 ESC 退出程序" << endl;
cout << "--------------------------" << endl;
}
int main() {
while (true) {
ShowControlPanel();
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000) break;
}