AW: Schliesskreuz bei UserForm entfernen
17.03.2005 16:26:32
K.Rola
Hallo,
'In ein Standardmodul
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16)
Sub Kreuz_weg(objUF As Object)
Dim hWnd As Long, lStyle As Long
Select Case Int(Val(Application.Version))
Case 8
hWnd = FindWindow("ThunderXFrame", objUF.Caption)
Case 9 To 11
hWnd = FindWindow("ThunderDFrame", objUF.Caption)
End Select
lStyle = GetWindowLong(hWnd, 0)
SetWindowLong hWnd, GWL_STYLE, lStyle Or WS_MAXIMIZEBOX
End Sub
'Ins Modul des userforms
Private Sub UserForm_Initialize()
Call Kreuz_weg(Me)
End Sub
Gruß K.Rola
Oscar Wilde