Graham,
That is quite a nice date picker, but I did find a couple of bugs in the APIs on Win 64 systems, as I have.
The RemoveTitlebar seems just 32-bit compatible
Private Sub RemoveTitleBar()
Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long
mhWndForm = FindWindow("ThunderDFrame", Caption)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000
SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
Height = Height - 24 + (Height - InsideHeight)
lbl_Exit:
Exit Sub
End Sub
It also needs to check for 64 bit as set the pointers as LongPtr
Private Sub RemoveTitleBar()
#If VBA7 Then
Dim lStyle As LongPtr
Dim hMenu As LongPtr
Dim mhWndForm As LongPtr
mhWndForm = FindWindow("ThunderDFrame", Caption)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000
SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
#Else
Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long
mhWndForm = FindWindow("ThunderDFrame", Caption)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000
SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm
#End If
Height = Height - 24 + (Height - InsideHeight)
End Sub
In the API defs, DrawMenuBar in the VBA7 conditional section was defined in the Win64 conditional sectional, but not the other. As it happens, I am not sure why that Win64 conditional sectional is there at all, VBA7 handles it all
#If VBA7 Then
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As LongPtr
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As LongPtr, _
ByVal nIndex As LongPtr) As LongPtr
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( _
ByVal hwnd As LongPtr, _
ByVal nIndex As LongPtr, _
ByVal dwNewLongptr As LongPtr) As LongPtr
Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
#Else
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
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
#End If
Apologies if grandma ... suck eggs and all that, but if you are Win32 you may not have noticed that, and sharing with 64 bit clients may give problems.