talsp
asked on
disable close/minimize boxes
hi,
how can i disable the close and minimze boxes in a simple formview?
thanks
how can i disable the close and minimze boxes in a simple formview?
thanks
Or, by the way.
The only way I know of to disable minimize/maximize buttons is to delete corresponing menu items
DeleteMenu(::GetSystemMenu (AfxGetMai nWnd()->m_ hWnd,FALSE ), SC_MINIMIZE, MF_BYCOMMAND);
after that minimiza item no longer present on system menu, and while minimize button still present and seems active it doesn't do anything....
The only way I know of to disable minimize/maximize buttons is to delete corresponing menu items
DeleteMenu(::GetSystemMenu
after that minimiza item no longer present on system menu, and while minimize button still present and seems active it doesn't do anything....
ASKER
i was looking for a way to disable the close/minimze boxes in the child windows.
can u help me out with it?
can u help me out with it?
mblat's way should work
It should be the same instead of AfxGetMainWnd() use CWnd* of a window that you want disabled....
If you are in that window you can use this pointer.
If you are in that window you can use this pointer.
ASKER
its wierd, i am doing:
DeleteMenu(::GetSystemMenu (this->m_h Wnd,FALSE) , SC_MINIMIZE, MF_BYCOMMAND);
in the CFormView i am using but nothing happens.
the minimize box still working.
DeleteMenu(::GetSystemMenu
in the CFormView i am using but nothing happens.
the minimize box still working.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Minimize menu doesn't exist.
its wierd i did the same with the SC_CLOSE and its working great, no close option in menu and the X button don't work.
btw: how do i overwrite th SC_MINIMIZE?
thanks
its wierd i did the same with the SC_CLOSE and its working great, no close option in menu and the X button don't work.
btw: how do i overwrite th SC_MINIMIZE?
thanks
ASKER
thanks a lot
i had another flag i didn't notice.
it working great.
thanks.
i had another flag i didn't notice.
it working great.
thanks.
Why B then? Moderator! Help!!!!!!!!!!!!!!!
to remove you need to overwrite PreCreateWindow and remove
some styles
Something in line of
LONG lStyle = ::GetWindowLong(hWnd, GWL_STYLE);
lStyle &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
::SetWindowLong(hWnd, GWL_STYLE, lStyle);
To disable close button use
EnableMenuItem(::GetSystem
Hope it helps...