17
Декабрь
2008
Вывод на экран текста, форма приобретает вид текста
Вывод на экран текста, форма приобретает вид текста.
Option Explicit 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 Sub Form_Load() Const TEXT = "Привет, я вирус!" Dim hRgn As Long Font.Name = "Times New Roman" Font.Bold = True Font.Size = 70 Width = TextWidth(TEXT) Height = TextHeight(TEXT) BeginPath hdc Print TEXT EndPath hdc hRgn = PathToRegion(hdc) SetWindowRgn hWnd, hRgn, False Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2 End Sub