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 SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Private Const LWA_COLORKEY = &H1
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMosT = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NosIZE = &H1
Dim a, b, c As Integer
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static FormX%, FormY%
If Button = 1 Then
Me.Move Me.Left - FormX + X, Me.Top - FormY + Y
ElseIf Button = 0 Then
FormX = X
FormY = Y
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 123
End
Case 122
c = c + 1
c = c Mod 256
Case 121
b = b + 1
b = b Mod 256
Case 120
a = a + 1
a = a Mod 256
Case 65
a = 255
b = 125
c = 255
Case 66
a = 125
b = 255
c = 255
Case 67
a = 255
b = 255
c = 125
Case 68
a = 0
b = 0
c = 0
Case 69
a = 255
b = 125
c = 125
Case 70
a = 125
b = 255
c = 125
Case 71
a = 125
b = 125
c = 255
End Select
End Sub
Private Sub Form_Load()
a = 255
b = 125
c = 255
Timer1.Interval = 500
AutoRedraw = True
Me.Width = 2000
Me.Height = 2000
Me.Top = 500
Me.Left = Screen.Width - 2500
Me.BackColor = RGB(88, 88, 88)
SetWindowPos Me.hWnd, HWND_TOPMosT, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NosIZE
Dim rtn As Long
BorderStyler = 0
rtn = GetWindowLong(hWnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hWnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hWnd, RGB(88, 88, 88), 0, LWA_COLORKEY
End Sub
Private Sub Timer1_Timer()
Me.Cls
Me.DrawWidth = 1
For i = 0 To 59
Me.PSet (1000 + Sin(0.104719 * i) * 900, 1000 - Cos(0.104719 * i) * 900), RGB(a, b, c)
If i Mod 5 = 0 Then
Me.DrawWidth = 4
Me.Circle (1000 + Sin(0.104719 * i) * 900, 1000 - Cos(0.104719 * i) * 900), 2, RGB(a, b, c)
Me.DrawWidth = 1
End If
Next i
Me.DrawWidth = 1
Me.Line (1000, 1000)-(1000 + Sin(0.104719 * Second(Time)) * 800, 1000 - Cos(0.104719 * Second(Time)) * 800), RGB(a, b, c)
Me.DrawWidth = 3
Me.Line (1000, 1000)-(1000 + Sin(0.104719 * Minute(Time)) * 650, 1000 - Cos(0.104719 * Minute(Time)) * 650), RGB(a, b, c)
Me.DrawWidth = 5
Me.Line (1000, 1000)-(1000 + Sin(0.523598 * (Hour(Time) + Minute(Time) / 60)) * 350, 1000 - Cos(0.523598 * (Hour(Time) + Minute(Time) / 60)) * 500), RGB(a, b, c)
End Sub