12 lines
396 B
C
12 lines
396 B
C
#include <c_WinGuiUtil.h>
|
|||
|
|
|
||
|
|
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);
|
||
|
|
}
|