以下の内容はhttps://blog.systemjp.net/entry/2024/08/21/141334より取得しました。


MFC top / left が 0 なら、親ウインドウの中心とこのウィンドウの中心が合うようにする

    // top / left が 0 なら、親ウインドウの中心とこのウィンドウの中心が合うようにする
    if (top == 0 && left == 0) {
        CWnd* pParentWnd = (CWnd*)GetParent();
        if (pParentWnd) 
        {
            CRect parentRect;
            pParentWnd->GetWindowRect(&parentRect);
            CRect dialogRect;
            GetWindowRect(&dialogRect);
            int parentCenterX = parentRect.left + (parentRect.Width() / 2);
            int parentCenterY = parentRect.top + (parentRect.Height() / 2);
            int dialogWidth = dialogRect.Width();
            int dialogHeight = dialogRect.Height();
            left = parentCenterX - (dialogWidth / 2);
            top = parentCenterY - (dialogHeight / 2);
        }
    }



以上の内容はhttps://blog.systemjp.net/entry/2024/08/21/141334より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14