Solved

SDI app with no border

Posted on 1997-06-03
5
665 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
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 84
if loop in java 3 142
ShiftLeft challenge 21 82
Problem to open Excel file 15 135
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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