Never mind that "complicated" statement. All I wanted to do was to toggle the titlebar and i simplified that milelong code you found to this and it works fine!
Code:
Public Function ToggleTitlebar(objForm As Form)
Dim r As RECT
SetWindowLong objForm.hWnd, GWL_STYLE, GetWindowLong(objForm.hWnd, GWL_STYLE) Xor (WS_THICKFRAME Or WS_CAPTION)
GetWindowRect objForm.hWnd, r
SetWindowPos objForm.hWnd, 0, r.Left, r.Top, r.Right - r.Left + 1, r.Bottom - r.Top, SWP_NOMOVE
End Function
Thanks again for the quick reply!