VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



TO make the maximum, minimum and close buttons invisible at runtime in any form

by Hema (4 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 8th March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

TO make the maximum, minimum and close buttons invisible at runtime in any form

API Declarations


'add the following code in the declaration section of any form
'this can be used for any form including mdi form

#If Win32 Then

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

#Else
Declare Function SetWindowLong Lib "User" (ByVal hwnd As Integer, _
ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "User" (ByVal hwnd As Integer, _
ByVal nIndex As Integer) As Long

#End If

Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
Const WS_SYSMENU = &H80000
'------------------------

Rate TO make the maximum, minimum and close buttons invisible at runtime in any form



'add the following code in the form load event of any form
Private Sub Form_Load()
Dim l As Long
    l = GetWindowLong(Me.hwnd, GWL_STYLE)
    l = l And Not (WS_SYSMENU)
    l = SetWindowLong(Me.hwnd, GWL_STYLE, l)
End Sub


Download this snippet    Add to My Saved Code

TO make the maximum, minimum and close buttons invisible at runtime in any form Comments

No comments have been posted about TO make the maximum, minimum and close buttons invisible at runtime in any form. Why not be the first to post a comment about TO make the maximum, minimum and close buttons invisible at runtime in any form.

Post your comment

Subject:
Message:
0/1000 characters