Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/05/2008, 10:37
Avellaneda
Colaborador
 
Fecha de Ingreso: enero-2008
Ubicación: Unas veces aquí, otras veces allí
Mensajes: 1.482
Antigüedad: 16 años, 3 meses
Puntos: 37
Respuesta: Vb 6.0 Sólo Botón De Minimizar En Formulario

Hola, buen día...

Prueba con algo así:

Código:
Option Explicit

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
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
    
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)


Private Sub Form_Load()
    Dim lRet As Long
    lRet = GetWindowLong(Me.hWnd, GWL_STYLE)
    lRet = lRet And Not (WS_MAXIMIZEBOX)
    lRet = SetWindowLong(Me.hWnd, GWL_STYLE, lRet)
    DesactivarMenu Me
End Sub

Private Sub DesactivarMenu(frm As Form)
    ' Desactiva las opciones del menú del Form (esq.superior izq)
    Dim hSysmenu As Long
    hSysmenu = GetSystemMenu(frm.hWnd, 0)
    RemoveMenu hSysmenu, 6, &H400&
    RemoveMenu hSysmenu, 5, &H400&
    RemoveMenu hSysmenu, 4, &H400&
    RemoveMenu hSysmenu, 2, &H400&
    RemoveMenu hSysmenu, 1, &H400&
End Sub