Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Const WS_BORDER = &H800000 Private Const WS_CAPTION = &HC00000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const GWL_STYLE = (-16) Friend Function HasMax(ByVal hwnd As Long) As Boolean Dim Style As Long Style = GetWindowLong(hwnd, GWL_STYLE) If ((Style And WS_MAXIMIZEBOX) = WS_MAXIMIZEBOX) = True Then HasMax = True Else HasMax = False End If End Function Friend Function HasMin(ByVal hwnd As Long) As Boolean Dim Style As Long Style = GetWindowLong(hwnd, GWL_STYLE) If ((Style And WS_MINIMIZEBOX) = WS_MINIMIZEBOX) = True Then HasMin = True Else HasMin = False End If End Function Friend Function HasTitleBar(ByVal hwnd As Long) As Boolean Dim Style As Long Style = GetWindowLong(hwnd, GWL_STYLE) If ((Style And WS_DLGFRAME) = WS_DLGFRAME = True) Then HasTitleBar = True Else HasTitleBar = False End If End Function Friend Function HasBorder(ByVal hwnd As Long) As Boolean Dim Style As Long Style = GetWindowLong(hwnd, GWL_STYLE) If ((Style And WS_BORDER) = WS_BORDER = True) Then HasBorder = True Else HasBorder = False End If End Function
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams