R – How to remove the border of the client area of a window

areaborderclientmfc

I don't want the border of a window's client area to be seen. Is there any way to remove them? The window is a SDI(Single Document) window.

I also noticed that the border appeares only on the top and left side of the client area (no on the right and bottom). I was very confused.

Thank you very much!

Best Solution

Would something like this be useful in your case ?

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    cs.style = WS_POPUP | WS_VISIBLE;  // or others you want
    cs.dwExStyle = 0;  // or others you want

    return CFrameWnd::PreCreateWindow(cs);
}

That involves overloading CWnd::PreCreateWindow in order to modify CREATESTRUCT which defines initialization parameters for a windows.

dwExStyle refers to the extended styles.

Related Question