MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / ResetMonitorResolution

Method ResetMonitorResolution

src/render/rd_app.cpp:699–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697 }
698
699 void RdApplication::ResetMonitorResolution(const std::string& name, int w, int h) {
700 DEVMODE dm;
701 dm.dmSize = sizeof(dm);
702 dm.dmPelsWidth = w;
703 dm.dmPelsHeight = h;
704 dm.dmBitsPerPel = 32;
705 dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
706 auto deviceName = StringUtil::ToWString(name);//L"\\\\.\\DISPLAY1";
707 LONG result = ChangeDisplaySettingsExW(deviceName.c_str(), &dm, nullptr, CDS_FULLSCREEN, nullptr);
708 bool ok = result == DISP_CHANGE_SUCCESSFUL;
709
710 tc::Message m;
711 m.set_type(tc::kChangeMonitorResolutionResult);
712 auto r = m.mutable_change_monitor_resolution_result();
713 r->set_monitor_name(name);
714 r->set_result(ok);
715 auto buffer = ProtoAsData(&m);
716 PostNetMessage(buffer);
717 }
718
719 std::shared_ptr<PluginManager> RdApplication::GetPluginManager() {
720 return plugin_manager_;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected