|
Создайте новый проект, свойство формы ScaleMode установить в 3-Pixel. На форму установите таймер, интервал подберите опытным путём... Вставьте этот код. 'Option Explicit
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
Const HWND_NOTOPMOST = -2
Const HWND_TOPMOST = -1
Const SWP_NOACTIVATE = &H10
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Dim message As String
Dim xpos() As Integer
Dim ypos() As Integer
Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long)
As Long
Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long)
As Long
Private Declare Function PathToRegion Lib "gdi32" (ByVal hdc As Long)
As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As
Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI)
As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim vv As POINTAPI
Dim hRgn As Long
Private Sub Form_Load()
Me.Move 0, 0, Screen.Width * Screen.TwipsPerPixelX, Screen.Height * Screen.TwipsPerPixelY
message = " -<(VIR)>-"
ReDim xpos(Len(message))
ReDim ypos(Len(message))
Timer1.Enabled = True
Call SetFormPosition(Me.hWnd, True)
End Sub
Public Sub SetFormPosition(frmHandl As Long, TopPosition As Boolean)
If TopPosition Then
SetWindowPos frmHandl, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOSIZE
Or SWP_NOMOVE
Else
SetWindowPos frmHandl, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
End If
End Sub
Private Sub Timer1_Timer()
GetCursorPos vv
xpos(1) = vv.X
ypos(1) = vv.Y
For i = Len(message) - 1 To 1 Step -1
xpos(i + 1) = xpos(i) + 20
ypos(i + 1) = ypos(i)
Next
Font.Name = "Times New Roman"
Font.Bold = True
Font.Size = 16
BeginPath hdc
For i = 1 To Len(message)
CurrentX = xpos(i)
CurrentY = ypos(i)
Print Mid(message, i, 1)
Next
EndPath hdc
hRgn = PathToRegion(hdc)
SetWindowRgn hWnd, hRgn, True
End Sub
|
|