Get rid of close button
Dorie Hannan -- DORIE@ris.risinc.com
Thursday, January 23, 1997
Environment: VC++ 4.2b, Win 95
I am attempting to do what I thought would be any easy task, get rid
of the close button of my window. I was able to disable the button
by getting the sysmenu and then calling
myMenu->EnableMenuItem( SC_CLOSE, MF_GRAYED);
While this works o.k. I really would like to not have the button at
all. I also tried
myMenu->DeleteMenu( SC_CLOSE, MF_BYCOMMAND );
This gets rid of the close option on the menu and grays the button
but the button is still there.
I'm sure I've overlooked something, I would love a helping
hand.
Thanks,
Dorie Hannan
Dorie@risinc.com
Grant Shirreffs Great Elk -- Grant.S@greatelk.com
Tuesday, January 28, 1997
Register your own Windows class:
CString sMyClass=AfxRegisterWndClass(CS_DBLCLKS | CS_NOCLOSE |
CS_HREDRAW | CS_VREDRAW)
and then, when you create your window, use sMyClass as the first
parameter.
>Original Message-----
From: Dorie Hannan [SMTP:dorie@ris.risinc.com]
Sent: Friday, 24 January, 1997 11:20
To: mfc-l@netcom.com
Subject: Get rid of close button
Environment: VC++ 4.2b, Win 95
I am attempting to do what I thought would be any easy task, get rid
of the close button of my window. I was able to disable the button
by getting the sysmenu and then calling
myMenu->EnableMenuItem( SC_CLOSE, MF_GRAYED);
While this works o.k. I really would like to not have the button at
all. I also tried
myMenu->DeleteMenu( SC_CLOSE, MF_BYCOMMAND );
This gets rid of the close option on the menu and grays the button
but the button is still there.
I'm sure I've overlooked something, I would love a helping
hand.
Thanks,
Dorie Hannan
Dorie@risinc.com
| Вернуться в корень Архива
|