⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 odcenter.c

📁 Windows 3.0 programming primer / Alan Southerton. 此书的配套软盘
💻 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 + -