Private Declare PtrSafe Function GetActiveWindow Lib "user32" () As LongPtr
Private Declare PtrSafe Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As LongPtr
Private Declare PtrSafe Function SetWindowRgn Lib "user32" (ByVal hWnd As LongPtr, ByVal hRgn As LongPtr, ByVal bRedraw As Long) As Long
Dim clock As Boolean
Private Sub Label1_Click(): clock = False: Unload Me: End Sub
Private Sub UserForm_Activate()
Dim RectLong As LongPtr, PtoPx#
With ActiveWindow.Panes(1)
PtoPx = 1 / ((.PointsToScreenPixelsX(7200) - .PointsToScreenPixelsX(0)) / 7200)
SetWindowRgn GetActiveWindow, CreateRoundRectRgn(0, 25, LblW * PtoPx, 26 + LblH * PtoPx, 0, 0), 1
Move .PointsToScreenPixelsX([f6].Left) * PtoPx, -20 + .PointsToScreenPixelsY([f6].Top) * PtoPx
End With
clock = True: Startclock
End Sub
Sub Startclock(): Do While clock = True: DoEvents: Label1 = Time: Loop: End Sub