int main() {
if (CreateConsole == false)
ShowWindow(GetConsoleWindow(), SW_HIDE);
bool WindowFocus = false;
while (WindowFocus == false) {
DWORD ForegroundWindowProcessID;
GetWindowThreadProcessId(GetForegroundWindow(), &ForegroundWindowProcessID);
if (GetProcessId(TargetProcess) == ForegroundWindowProcessID) {
Process::ID = GetCurrentProcessId();
Process::Handle = GetCurrentProcess();
Process::Hwnd = GetForegroundWindow();
RECT TempRect;
GetWindowRect(Process::Hwnd, &TempRect);
Process::WindowWidth = TempRect.right - TempRect.left;
Process::WindowHeight = TempRect.bottom - TempRect.top;
Process::WindowLeft = TempRect.left;
Process::WindowRight = TempRect.right;
Process::WindowTop = TempRect.top;
Process::WindowBottom = TempRect.bottom;
char TempTitle[MAX_PATH];
GetWindowText(Process::Hwnd, TempTitle, sizeof(TempTitle));
Process::Title = TempTitle;
char TempClassName[MAX_PATH];
GetClassName(Process::Hwnd, TempClassName, sizeof(TempClassName));
Process::ClassName = TempClassName;
char TempPath[MAX_PATH];
GetModuleFileNameEx(Process::Handle, NULL, TempPath, sizeof(TempPath));
Process::Path = TempPath;
WindowFocus = true;
}
}
OverlayWindow::Name = RandomString(10).c_str();
SetupWindow();
DirectXInit();
CreateThread(0, 0, ProcessCheck, 0, 0, 0);
while (true) {
MainLoop();
}
hwnd = FindWindow(0, "window");
if (hwnd == NULL) {
Sleep(1000);
return 0;
}
procID = 0;
GetWindowThreadProcessId(hwnd, &procID);
if (procID == 0) {
return 0;
}
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
if (bool123 == true) {
Void123();
}
}