mirror of
https://github.com/cheat-engine/cheat-engine
synced 2026-08-15 02:26:08 -04:00
35 lines
639 B
C++
35 lines
639 B
C++
#include <iostream>
|
|
#include <windows.h>
|
|
|
|
class RestoreUCWin {
|
|
|
|
RestoreUCWin()
|
|
{
|
|
HWND h = GetActiveWindow();
|
|
if (! h) return;
|
|
RECT rt;
|
|
std::ifstream in("/_pos.txt");
|
|
if (in) {
|
|
in >> rt.left >> rt.top >> rt.right >> rt.bottom;
|
|
MoveWindow(h,rt.left,rt.top,rt.right-rt.left,rt.bottom-rt.top,1);
|
|
}
|
|
}
|
|
|
|
~RestoreUCWin()
|
|
{
|
|
HWND h = GetActiveWindow();
|
|
if (! h) return;
|
|
RECT rt;
|
|
GetWindowRect(h,&rt);
|
|
std::ofstream out("/_pos.txt");
|
|
out << rt.left << ' ' << rt.top << ' ' << rt.right << ' ' << rt.bottom << std::endl;
|
|
}
|
|
|
|
};
|
|
|
|
RestoreUCWin __uc__;
|
|
|
|
|
|
|
|
|
|
|