Click to See Complete Forum and Search --> : How to display a window with no caption bar


April 22nd, 1999, 11:35 AM
Hi, I try to use CSrollView in my application. To do this, I can use VC++ to create a SDI application and select CScrollView in the creation process. But in my application, I don't want to see any caption bar, system menu, and windows border. I don't know how to do it. Does anyone know how to do it? Thanks.

delbert Harry
April 23rd, 1999, 09:09 AM
use the ModifyStyle function.

Ex.
ModifyStyle(0, WS_CAPTION);

May 14th, 1999, 02:17 AM
I have tried your solution to remove WS_CAPTION | WS_BORDER | WS_SYSMENU,
but only system menu is removed. Why? Need further help.

Best regards,

Shaowen Cheng
u0298@acs.hinet.net

pakas
May 18th, 1999, 06:40 PM
override OnCreate() CMainFrame n use
ModifyStyle( WS_CAPTION | WS_SYSMENU, 0);
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
ModifyStyle( WS_CAPTION | WS_SYSMENU, 0);

return 0;
}
//to remove menu bar
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if (cs.hMenu != NULL)
{
::DestroyMenu(cs.hMenu);
cs.hMenu = NULL;
}

return CFrameWnd::PreCreateWindow(cs);
}

Jaeyeon Lee
May 18th, 1999, 07:38 PM
Try to add WS_POPUP style to your main frame window.
Overlapped windows ( WS_OVERLAPPED, this is the default style) should have caption bar.

pakas
May 20th, 1999, 05:52 PM
in ur precreatewindow()
add
cs.style = WS_DLGFRAME as well besides modifystyle()...
Example:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_DLGFRAME;
return CFrameWnd::PreCreateWindow(cs);
}