Code zusammenfügen?
Mark
kann man den folgenden Code irgendwie zusammenfassen? Die Declaration oben muß so bleiben, dass ist klar. Kann man aber nicht den Inhalt von "Sub Kreuz_weg" in diesen Part einbauen?
Private Sub UserForm_Initialize()
Call Kreuz_weg(Me)
End Sub
Danke für jede Antwort.
-Mark-
Hier der Quellcode:
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)
Private Sub UserForm_Initialize()
Call Kreuz_weg(Me)
End Sub
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