MCPcopy Create free account
hub / github.com/cafali/SnapKey / ApplyLayout

Function ApplyLayout

SnapKey.cpp:77–91  ·  view source on GitHub ↗

apply layout (replace config.cfg content) v 1.2.9

Source from the content-addressed store, hash-verified

75
76// apply layout (replace config.cfg content) v 1.2.9
77void ApplyLayout(const string& layoutName) {
78 string sourcePath = "meta\\profiles\\" + layoutName + ".cfg";
79 string destPath = "config.cfg";
80
81 ifstream src(sourcePath, ios::binary);
82 ofstream dst(destPath, ios::binary | ios::trunc);
83
84 if (!src.is_open() || !dst.is_open()) {
85 MessageBox(NULL, TEXT("Failed to apply layout. Please check the layout file."),
86 TEXT("SnapKey Error"), MB_ICONERROR | MB_OK);
87 return;
88 }
89
90 dst << src.rdbuf(); // copy file contents
91}
92
93// restart
94void RestartSnapKey() {

Callers 1

WndProcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected