📄 odcenter.c
字号:
HWND CreateODcenter(hInstance, nCmdShow, cx, cy)
HANDLE hInstance;
int nCmdShow;
int cx, cy;
{
HWND hwnd;
int x, y;
int xDesktop, yDesktop;
hInst = hInstance;
/* Get dimensions of desktop (that is, screen) */
xDesktop = GetSystemMetrics(SM_CXSCREEN);
yDesktop = GetSystemMetrics(SM_CYSCREEN);
/* Do simple calculations */
x = (xDesktop - cx) / 2;
y = (yDesktop - cy) / 2;
/* Call CreateWindow with new dimensions */
hwnd = CreateWindow(
"SampleClass",
"Sample Program",
WS_OVERLAPPEDWINDOW,
x,
y,
cx,
cy,
NULL,
NULL,
hInstance,
NULL);
if(!hwnd)
return(FALSE);
ShowWindow(hwnd,nCmdShow);
UpdateWindow(hwnd);
return(hwnd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -