KeyMouse
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user