Alias "SetWindowLongA" (ByVal,标题:让最大化和最小化按钮消失" /> 让最大化和最小化按钮消失 - 关于VB的经验之谈 - VB爱好者乐园(VBGood) - 关于VB的经验,电子教程,代码,控件,论坛,博客,微博等.

VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 让最大化和最小化按钮消失
发表评论(0)作者:, 平台:, 阅读:13024, 日期:2000-03-12
声明:

Private Declare Function SetWindowLong Lib "user32" _

Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal _

nIndex As Long, ByVal dwNewLong As Long) As Long


Private Declare Function GetWindowLong Lib "user32" _

Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal _

nIndex As Long) As Long

Const WS_MINIMIZEBOX = &H20000

Const WS_MAXIMIZEBOX = &H10000

Const GWL_STYLE = (-16)

使用:

Private Sub Form_Load()

Dim lWnd As Long

lWnd = GetWindowLong(Me.hwnd, GWL_STYLE)


lWnd = lWnd And Not (WS_MINIMIZEBOX)

lWnd = lWnd And Not (WS_MAXIMIZEBOX)

lWnd = SetWindowLong(Me.hwnd, GWL_STYLE, lWnd)

End Sub