一般情况下MFC不设置标题栏就可以只有一个客户区了,但是左边和上边会有细线,仔细看看的话右边和下边也有浅一点的细线,这个时候设置WS_EX_CLIENTEDGE就能有作用了
VOID myDialog::removeBorder()
{
DWORD dw = ::GetWindowLong(GetSafeHwnd(), GWL_STYLE);
dw = dw & ~WS_POPUP;//取消弹出式窗体属性
dw = dw & ~WS_CAPTION;//取消标题栏
dw = dw & ~WS_THICKFRAME;//取消拖动改变大小
//dw = dw | WS_CHILD;//属性必须设为WS_CHILD
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dw);
dw = ::GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);
dw = dw & ~WS_EX_DLGMODALFRAME;
dw = dw & ~WS_EX_CLIENTEDGE;
::SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, dw);
}