Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing Server/CenterFrameCaptionMod.bas (880 B)
Attribute VB_Name = "CenterFrameCaptionMod"
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
Private Const BS_CENTER = &H300
Private Const GWL_STYLE = (-16)
Sub CenterFrameCaption(FrameObj As Frame)
SetWindowLong FrameObj.hWnd, GWL_STYLE, GetWindowLong(FrameObj.hWnd, GWL_STYLE) Or BS_CENTER
End Sub
Sub CenterFrameCaptionAll(FormObj As Form)
Dim Control As Control
Dim FrameObj As Frame
For Each Control In FormObj.Controls
If TypeOf Control Is Frame Then
Set FrameObj = Control
CenterFrameCaption FrameObj
Set FrameObj = Nothing
End If
Next Control
End Sub
Download Server/CenterFrameCaptionMod.bas