龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VB开发 >

去掉窗体的关闭按钮

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
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->

精彩图集

赞助商链接