#include void c_WinGuiUtil_MoveWindowToScreenCenter(HWND hwnd){ int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); RECT Rect; GetWindowRect(hwnd, &Rect); int x = (width - (Rect.right - Rect.left))/2; int y = (height - (Rect.bottom - Rect.top))/2; SetWindowPos(hwnd, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); }