I create a project using MFC Appwizard(exe), SDI and CFormView .
In the CMainFrame::PreCreateWindow class,
I change the cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
statement to the following
cs.style = WS_DLGFRAME
cs.style = WS_OVERLAPPED | ~WS_CAPTION
cs.style = WS_DLGFRAME | ~WS_CAPTION.
and more ...
but none of those above statements work.
I would very much appreciate if anyone can provide me with a real
solution. ( I have spent many hours already. )
Thanks in advance
Kim
that might be so, but if you would want to remove the title bar from a
window you could (fx) use the WS_POPUP style.
btw. look the WS_* styles up in winuser.h, the header files are a source
of documentation not to be overlooked...
________ _ ____ ______ _______ _______ _______ ___ ____
/ / \/ / __ \/ \| __ \/ / | |
/ _____/\ /| / | \ / ____/| | |
\ \ | | | __ \ | / \ \| |
\_______\|____| |_______/\_______/|___|___/\______\____|____|
#include <disclaimer.h>
I got it to work some time ago in a VC++ 1.52 application by setting the
style to WS_POPUP but I couldn't get anything to work with VC++ 5.
--
Gordon Smith
A side effect of not having a title bar (i.e. using WS_POPUP) is that
the user cannot close it or otherwise manipulate it via the task bar. In
other words the menu you popup over the task bar entry for the program
won't have any of the move/size/close/etc... entries in it, because
those are driven by the system meny entries of the program (and you
won't have any.) So provide some way for the user to do whatever is
needed via your program's interface I guess (or find some way to force
these entries into the task bar menu.)
I did a little system information display program a long time ago as an
entre into Win32 (from OS/2) and it used WS_POPUP and just put itself in
the upper right corner. But you couldn't close the little guy without
putting a close button on it, which took up valuable space because this
little program was intended to be as (visually) small as possible and
stay out of the way.
------------------------------------
Dean Roddey
Sr. Software Engineer
Taligent, Inc
dean_...@taligent.com
Rosa Bernárdez
Ken
Dean Roddey wrote:
> CyBorch wrote:
> >
> > Robert Youdan wrote:
<snipped>
> A side effect of not having a title bar (i.e. using WS_POPUP) is that
> the user cannot close it or otherwise manipulate it via the task bar. In
> other words the menu you popup over the task bar entry for the program
> won't have any of the move/size/close/etc... entries in it, because
> those are driven by the system meny entries of the program (and you
> won't have any.) So provide some way for the user to do whatever is
> needed via your program's interface I guess (or find some way to force
> these entries into the task bar menu.)
>
> I did a little system information display program a long time ago as an
> entre into Win32 (from OS/2) and it used WS_POPUP and just put itself in
> the upper right corner. But you couldn't close the little guy without
> putting a close button on it, which took up valuable space because this
> little program was intended to be as (visually) small as possible and
> stay out of the way.
>
However, nowadays you don't necessarily have to put a button on the app, you
could use a popup menu that displays only when you right-click on the window,
from this one could choose to close the window, or what have you
NH
> > Kim
You must try
cs.style = WS_OVERLAPPED & ~WS_CAPTION
cs.style = WS_DLGFRAME & ~WS_CAPTION.
That won't work. An "overlapped" window *always* has a caption. Only
"popup" or "child" windows can be created with no caption.
Chris
----------------------------------------------------------------
Chris Marriott, Microsoft Certified Solution Developer.
SkyMap Software, U.K. e-mail: ch...@skymap.com
Visit our web site at http://www.skymap.com
void NEAR PASCAL SetMenuBar( HWND hWnd )
{
static DWORD wID;
DWORD dwStyle;
dwStyle = GetWindowLong( hWnd, GWL_STYLE );
if( ClockDisp.bNoTitle ) {
/* remove caption & menu bar, etc. */
dwStyle &= ~(WS_DLGFRAME | WS_SYSMENU |
WS_MINIMIZEBOX | WS_MAXIMIZEBOX );
wID = SetWindowLong( hWnd, GWL_ID, 0 );
}
else {
/* put menu bar & caption back in */
dwStyle = WS_TILEDWINDOW | dwStyle;
SetWindowLong( hWnd, GWL_ID, wID );
}
SetWindowLong( hWnd, GWL_STYLE, dwStyle );
SetWindowPos( hWnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
SWP_NOZORDER | SWP_FRAMECHANGED );
ShowWindow( hWnd, SW_SHOW );
}
Chris Marriott <ch...@chrism.demon.co.uk> wrote in article
<HEaoNXAw...@chrism.demon.co.uk>...