Non-Resizable, Non-Movable Window
Posted
by Siarhei Akulich
on February 26th, 2003
If you want to work with nonresizable, nonmovable windows, insert this code into your project (SDI or MDI applications).
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (BaseClass::OnCreate(lpCreateStruct) == -1)
return -1;
// Do something
// Remove positions of menu
CMenu* pTopMenu = GetSystemMenu(FALSE);
if(pTopMenu != NULL)
{
pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //Size
pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //Move
pTopMenu -> RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND); //Maximize
}
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !BaseClass::PreCreateWindow(cs) )
return FALSE;
// Create a window without max button and sizable border
cs.style &= ~(WS_MAXIMIZEBOX|WS_THICKFRAME);
return TRUE;
}

Comments
How about Non-Moveable Win32 dialog (WinCE 3.0)Application
Posted by Legacy on 04/09/2003 12:00amOriginally posted by: Francis
Replykeyboard windows key control
Posted by Legacy on 04/03/2003 12:00amOriginally posted by: leo
Sir
I am doing my MCA. I have a project. I have a doubt about how can control windows key in KEYBOARD.
for example
i have a login menu. My aim is user should enter into my login way.
The Problem is
ReplyThey have to move using start button(windows key) and they can access like msword are else.
So please kindly help me how can i control windows key. help me.
Thanking you sir
How about Dialogs
Posted by Legacy on 02/18/2002 12:00amOriginally posted by: Mikael
Is it possible to make Dialog windows Nonmovable too ?
ReplyHow to remove resizing of window when double click in caption
Posted by Legacy on 07/20/2001 12:00amOriginally posted by: Sveinung Tollefsen
I have tryed the method decribed, and it work fine exept if I double click in the caption the window resizes away from MAXIMIZE.
I have added the line
pFrame->ModifyStyle( 0,0,SWP_NOSIZE );
But this did not help.
Any sugestions?
ReplyHow to make ActiveX nonresizable?
Posted by Legacy on 07/16/2001 12:00amOriginally posted by: Dave Smith
I am designing an ActiveX which needs nonresiable, i copy code here to
ReplyCSampleCtrl::PreCreateWindow(CREATESTRUCT& cs),
it does not work, ActiveX still can resize, it works for .exe.
How to prevent positioning of an external program's window
Posted by Legacy on 07/12/2001 12:00amOriginally posted by: Peter Hentrich
Reply