Main window without 3d boder

How to create a Main Window (using createWindow) which has
window caption and menu, without the 3d boder. (ie) like
WS_POPUP.

Thans in advance.
kalai26Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
yuryzConnect With a Mentor Commented:
Try this:
1. react on WM_CREATE message sent to your main window
2. add this code:

       DWORD dwStyle = GetWindowLong( GetSafeHwnd(),WL_EXSTYLE );
      dwStyle &= ~( WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE );
      SetWindowLong( GetSafeHwnd(), GWL_EXSTYLE, dwStyle );
3. resize window to the size it was last time started, or any specific size you need.

0
 
wyy_cqCommented:
you may try thin border sytle.

0
 
nietodCommented:
There is no thin border style.  There is a thick border style, WS_THICKFRAME, don't specify that to begin with.  Also don't specify the WS_DLGFRAME style.  Make sure you don't specify any styles that contain these styles "inside" them. like WS_OVERLAPPEDWINDOW.  Do specify the WS_BORDER style.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
nietodCommented:
What is happening with this question?
0
 
kalai26Author Commented:
Regarding wyy_cq's proposed answer, there is no thin boder....

Regarding "nietod" comments, it is very close to what I want
but it is not removing the boder completely.

Here are more details and calling sequence in my program:

    WinMain()
    RegisterWindowEx()
    CreateWindowEx()
 
and I am not using MFC. I have used many combinations but I am
still seeing a thin boder!!

Is anyone know how to get-ride of the boder, using Win32 porgramming.
0
 
nietodCommented:
By default, windows don't have a bordert.  You are adding a border, probably by specifying the WS_BORDER style or another style that includes that style.  Make sure you are not specifying that style.  If you can't figure that out, post the code where you create the window.
0
 
wyy_cqCommented:
i mean WS_THICKFRAME .
i write a dialog base demo, and i find that even if i select the thin border style , the dialog has a 3d border.
perhaps win95 cancel the style.

you may deal with WM_NCPAINT ,and paint the simple line on the edge of the window if you could not find a better idea.
0
 
wyy_cqCommented:
you may try to modify the window's style after creation.

you can delete the style and exStyle which may generate a 3d border.
setWindowLong(...);
0
 
nietodCommented:
I'm confused, what is the goal here?  To create a window with no border or to create one with a thin border?
0
 
kalai26Author Commented:
Create a window with NO BODER.
0
 
nietodCommented:
Then just don't specify any border styles.  If that isn't working, post the code that you use to create the window so we can ofter suggestions.
0
 
nietodCommented:
yuryz, why bother doing all that?  just specify the styles you want when you create the window.  The problem is that kalai26 is using the wrong styles.

Also you can assume that if there has been no response in the last 4 weeks, that kalai26 is no longer looking for an answer.
0
 
yuryzCommented:
hah ! try it yourself ! seems like styles being always added if not by MFC, then by windows itself...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.