去掉窗体的关闭按钮
PrivateDeclareFunctionGetSystemMenuLib"User32"(ByValhwndAsLong,ByValbRevertAsLong)AsLong PrivateDeclareFunctionRemoveMenuLib"User32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLong PrivateDeclareFunctionDrawMenuBarLib"User32"(
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->
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->
- 上一篇:VB调用API函数使窗口保持在最上层
- 下一篇:椭圆形的窗体
精彩图集
精彩文章