[comp.windows.ms] Disabling system menu

kipnis@janus.berkeley.edu (Gary Kipnis) (06/22/89)

Hi, I am trying to disable 'Size' option on the system menu, I used 
GetSystemMenu and EnableMenuItem(hSysMenu, 3, MF_BYPOSITION | MF_DISABLE),
but nothing happened, the 'Size' option was still enabled...

does anyone have any suggestions regarding above???

Thanks,

gary

bturner@hpcvlx.HP.COM (Bill Turner) (06/23/89)

> Hi, I am trying to disable 'Size' option on the system menu, I used 
> GetSystemMenu and EnableMenuItem(hSysMenu, 3, MF_BYPOSITION | MF_DISABLE),
> but nothing happened, the 'Size' option was still enabled...

Did you call DrawMenuBar afterwards?  I know that for the app menu this is
required for the changes to appear -- this is NOT the same as taking effect,
as that should occur immediately.

You could also try EnableMenuItem(hSysMenu, SC_SIZE, MF_BYPOSITION | MF_DISABLE)
and see how that works...

--Bill Turner (bturner@hp-pcd.hp.com)
HP Corvallis Information Systems

bturner@hpcvlx.HP.COM (Bill Turner) (06/28/89)

Yoiks, I must be blind or going senile...  Michael Roper from hDC pointed
out to me that I meant to say MF_BYCOMMAND rather than MF_BYPOSITION, but
I could have sworn that that was what I said...

The line should read

    EnableMenuItem(hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_DISABLED)

--Bill Turner (bturner@hp-pcd.hp.com)
"I know what it says, but what does it mean?"  --Doctor #2, "The Five Doctors"