Solved

SDI app with no border

Posted on 1997-06-03
5
686 Views
Last Modified: 2013-11-20
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(NULL, 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!

0
Comment
Question by:JanetG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:umesh053097
ID: 1301952
You could try using SetWindowLong or SetClassLong in the OnCreatehandler of the derived CFrameWnd class after the default OnCreate.For example,if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
            return -1;DWORD dwClassStyle = ::GetClassLong(m_hWnd, GCL_STYLE);
dwClassStyle |= CS_SAVEBITS;
::SetClassLong(m_hWnd, GCL_STYLE, dwClassStyle);
0
 

Author Comment

by:JanetG
ID: 1301953
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.


0
 

Expert Comment

by:umesh053097
ID: 1301954
TrySetWindowLong(m_hWnd, GWL_STYLE, WS_POPUP);
Seems to work.
0
 
LVL 3

Expert Comment

by:byang
ID: 1301955
PreCreateWindow() should work. Can you post your PreCreateWindow() code here ?
0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1301956
Do the following in your frame window PreCreateWindow(),

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);
}

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question