【 tulaoshi.com - 编程语言 】
PrivateDeclareFunctionGetSystemMenuLib"User32"(ByValhwndAsLong,ByValbRevertAsLong)AsLong
PrivateDeclareFunctionRemoveMenuLib"User32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLong
PrivateDeclareFunctionDrawMenuBarLib"User32"(ByValhwndAsLong)AsLong
PrivateDeclareFunctionGetMenuItemCountLib"User32"(ByValhMenuAsLong)AsLong
PrivateConstMF_BYPOSITION=&H400&
PrivateConstMF_DISABLED=&H2&
PrivateSubForm_Load()
CallDisableX(Me)
EndSub
PrivateSubDisableX(FrmAsForm)
DimhMenuAsLong,nCountAsLong
hMenu=GetSystemMenu(Frm.hwnd,0)
nCount=GetMenuItemCount(hMenu)
CallRemoveMenu(hMenu,nCount-1,MF_DISABLEDOrMF_BYPOSITION)
DrawMenuBarFrm.hwnd
EndSub->