JanetG
asked on
SDI app with no border
I want to create an SDI app with no border, title bar, min/max or system menu. I tried to do this in the PreCreateWindow() of my class derived from CFrameWnd but my negating the WS_SYSMENU, WS_CAPTION, WS_BORDER, and WS_THICKFRAME just get ignored. On advice from another user I did the following in InitInstance() of CMyApp:
m_pMainWnd->ModifyStyle(WS _CAPTION | WS_THICKFRAME | WS_BORDER, WS_CLIPCHILDREN );
m_pMainWnd->SetWindowPos(N ULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
SWP_NOZORDER | SWP_DRAWFRAME);
m_pMainWnd->ShowWindow(SW_ SHOW);
m_pMainWnd->UpdateWindow() ;
For reasons I don't understand, the WS_BORDER in the above code makes the difference between a title bar showing up or not. But with the WS_BORDER, I of course get a border around my app.
So, my question is this: how can I create an SDI app without a border, min/max, system menu and title bar?
Thanks!
m_pMainWnd->ModifyStyle(WS
m_pMainWnd->SetWindowPos(N
SWP_NOZORDER | SWP_DRAWFRAME);
m_pMainWnd->ShowWindow(SW_
m_pMainWnd->UpdateWindow()
For reasons I don't understand, the WS_BORDER in the above code makes the difference between a title bar showing up or not. But with the WS_BORDER, I of course get a border around my app.
So, my question is this: how can I create an SDI app without a border, min/max, system menu and title bar?
Thanks!
ASKER
No, this doesn't have any affect (and in fact I had already tried this). If I spy on the window I see the styles are turned off--but for some reason I continue to see a border around my app.
Before replying with suggestions, please just give it a try. Try to create an SDI app with no border, no title bar, no system menu, and no min/max.
Thanks.
Before replying with suggestions, please just give it a try. Try to create an SDI app with no border, no title bar, no system menu, and no min/max.
Thanks.
TrySetWindowLong(m_hWnd, GWL_STYLE, WS_POPUP);
Seems to work.
Seems to work.
PreCreateWindow() should work. Can you post your PreCreateWindow() code here ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
return -1;DWORD dwClassStyle = ::GetClassLong(m_hWnd, GCL_STYLE);
dwClassStyle |= CS_SAVEBITS;
::SetClassLong(m_hWnd, GCL_STYLE, dwClassStyle);