Csdn-Blog <script language="javascript" src="http://www.023rcsc.com/count/count2.asp"></script>
'屏蔽关闭和最大化按钮,只保留最小化按钮
OptionExplicit
PrivateDeclareFunctionGetSystemMenuLib"USER32"(ByValhwndAsLong,ByValbRevertAsLong)AsLong
PrivateDeclareFunctionRemoveMenuLib"USER32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLong
PrivateConstMF_BYCOMMAND=&H0&
PrivateConstSC_CLOSE=&HF060&
'--------------------------------------
PrivateDeclareFunctionGetWindowLongLib"USER32"Alias"GetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong)AsLong
PrivateDeclareFunctionSetWindowLongLib"USER32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
PrivateConstGWL_STYLE=(-16)
PrivateConstWS_MAXIMIZEBOX=&H10000
'PrivateConstWS_MINIMIZEBOX=&H20000
PrivateSubForm_Load()
DimMyMenuAsLong
MyMenu=GetSystemMenu(Me.hwnd,0)'得到系统菜单的句柄,Me.hwnd表示当前窗体的句柄
RemoveMenuMyMenu,SC_CLOSE,MF_BYCOMMAND'屏蔽关闭按钮
'下面代码屏蔽最大化按钮
DimmdiWndAsLong
mdiWnd=GetWindowLong(Me.hwnd,GWL_STYLE)
mdiWnd=mdiWndAndNot(WS_MAXIMIZEBOX)
mdiWnd=SetWindowLong(Me.hwnd,GWL_STYLE,mdiWnd) EndSub
屏蔽关闭和最大化按钮,只保留最小化按钮 src="http://www.023rcsc.com/count/iframe2.asp" frameborder="0" width="650" scrolling="no" height="160">
屏蔽关闭和最大化按钮,只保留最小化按钮
bsp'屏蔽关闭和最大化按钮,只保留最小化按钮
OptionExplicit
PrivateDeclareFunctionGetSystemMenuLib"USER32"(ByValhwndAsLong,ByValbRevertAsLong)AsLong
PrivateDeclareFunctionRemoveMenuLib"USER32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLong
PrivateConstMF_BYCOMMAND=&H0&
PrivateConstSC_CLOSE=&HF060&
'--------------------------------------
PrivateDeclareFunctionGetWindowLongLib"USER32"Alias"GetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong)AsLong
PrivateDeclareFunctionSetWindowLongLib"USER32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
PrivateConstGWL_STYLE=(-16)
PrivateConstWS_MAXIMIZEBOX=&H10000
'PrivateConstWS_MINIMIZEBOX=&H20000
PrivateSubForm_Load()
DimMyMenuAsLong
MyMenu=GetSystemMenu(Me.hwnd,0)'得到系统菜单的句柄,Me.hwnd表示当前窗体的句柄
RemoveMenuMyMenu,SC_CLOSE,MF_BYCOMMAND'屏蔽关闭按钮
'下面代码屏蔽最大化按钮
DimmdiWndAsLong
mdiWnd=GetWindowLong(Me.hwnd,GWL_STYLE)
mdiWnd=mdiWndAndNot(WS_MAXIMIZEBOX)
mdiWnd=SetWindowLong(Me.hwnd,GWL_STYLE,mdiWnd) EndSub
屏蔽关闭和最大化按钮,只保留最小化按钮 src="http://www.023rcsc.com/count/iframe2.asp" frameborder="0" width="650" scrolling="no" height="160">