MCPcopy Create free account
hub / github.com/TASEmulators/fceux / CenterWindowOnScreen

Function CenterWindowOnScreen

src/drivers/win/gui.cpp:47–63  ·  view source on GitHub ↗

* Centers a window on the screen. * * @param hwnd The window handle. **/

Source from the content-addressed store, hash-verified

45* @param hwnd The window handle.
46**/
47void CenterWindowOnScreen(HWND hwnd)
48{
49 RECT rect;
50
51 GetWindowRect(hwnd, &rect);
52
53 unsigned int screenwidth = GetSystemMetrics(SM_CXSCREEN);
54 unsigned int screenheight = GetSystemMetrics(SM_CYSCREEN);
55
56 unsigned int width = rect.right - rect.left;
57 unsigned height = rect.bottom - rect.top;
58
59 unsigned x = (screenwidth - width) / 2;
60 unsigned y = (screenheight - height) / 2;
61
62 MoveWindow(hwnd, x, y, width, height, FALSE);
63}
64
65/**
66* Changes the state of the mouse cursor.

Callers 6

GUIConCallBFunction · 0.85
DirConCallBFunction · 0.85
MapInputDialogProcFunction · 0.85
TimingConCallBFunction · 0.85
InputConCallBFunction · 0.85
PaletteConCallBFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected