Toggle a Form's Caption Bar at Runtime
This code allows a user to Toggle the caption bar (toolbox and all) on a form at runtime. Normally you cannot visually change some of the form's settings at runtime this solves one of those instances. Code can be fairly easily changed so as to accept a parameter for if you want the caption or not. This is just a simple example.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Private Sub ToggleFormCaption() Dim rcWindow As RECT Dim lRet As Long lRet = GetWindowRect(Me.hwnd, rcWindow) lRet = SetWindowLong(Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) Xor WS_CAPTION) lRet = SetWindowPos(Me.hwnd, 0, 0, 0, rcWindow.Right - rcWindow.Left + 1, rcWindow.Bottom - rcWindow.Top, SWP_NOMOVE) lRet = SetWindowPos(Me.hwnd, 0, 0, 0, rcWindow.Right - rcWindow.Left, rcWindow.Bottom - rcWindow.Top, SWP_NOMOVE) End Sub
Original Comments (3)
Recovered from Wayback Machine