Option Explicit
Private Declare Function DrawWideChars Lib "user32.dll" Alias "DrawTextW" (ByVal hDC As Long, lpChar As Integer, ByVal nCount As Long, ByRef lpRect As RECT, ByVal wFormat As Long) As Long
Private Declare Function BeginPath Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function EndPath Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function PathToRegion Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const DT_NOCLIP = &H100
Private Sub Form_Load()
Dim rc As RECT
AutoRedraw = True
FontName = "Monotype Corsiva"
FontSize = 144
BeginPath hDC
DrawWideChars hDC, &H2665, 1, rc, DT_NOCLIP
EndPath hDC
SetWindowRgn hWnd, PathToRegion(hDC), False
End Sub
GSerg писал(а):Дык Тёмыч - он хитрый
lpChar As Integer замени на byval s as string.
Option Explicit
Private Declare Function DrawWideChars Lib "user32.dll" Alias "DrawTextW" (ByVal hDC As Long, lpChar As Integer, ByVal nCount As Long, ByRef lpRect As RECT, ByVal wFormat As Long) As Long
Private Declare Function BeginPath Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function EndPath Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function PathToRegion Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const DT_NOCLIP = &H100
Private Sub Form_Load()
Dim MyChars(4) As Integer
MyChars(0) = &HB7
MyChars(1) = &H42F
MyChars(2) = &H20
MyChars(3) = &H2665
MyChars(4) = &H222B
Dim rc As RECT
AutoRedraw = True
FontName = "Monotype Corsiva"
FontSize = 144
BeginPath hDC
DrawWideChars hDC, MyChars(0), 5, rc, DT_NOCLIP
EndPath hDC
SetWindowRgn hWnd, PathToRegion(hDC), False
Width = 9600
End Sub
Option Explicit
Private Declare Function WideCharsOut Lib "gdi32.dll" Alias "TextOutW" (ByVal hDC As Long, ByVal nXStart As Long, ByVal nYStart As Long, lpChar As Integer, ByVal nCount As Long) As Long
Private Declare Function BeginPath Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function EndPath Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function PathToRegion Lib "gdi32.dll" (ByVal hDC As Long) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const DT_NOCLIP = &H100
Private Sub Form_Load()
Dim MyChars(4) As Integer
MyChars(0) = &HB7
MyChars(1) = &H42F
MyChars(2) = &H20
MyChars(3) = &H2665
MyChars(4) = &H222B
AutoRedraw = True
FontName = "Monotype Corsiva"
FontSize = 144
BeginPath hDC
WideCharsOut hDC, 0, 0, MyChars(0), 5
EndPath hDC
SetWindowRgn hWnd, PathToRegion(hDC), False
Width = 9600
End Sub
GSerg писал(а):Предлагаю не страдать фигнёй с массивами, а объявить-таки как Long и передавать StrPtr
Ибо строки всё-таки
GSerg писал(а):Ну, объявил.
И чё?
Снова "Роль ByVal в истории"?
tyomitch писал(а):Kovu, надо передавать ByVal StrPtr(ChrW(&HB7) & ChrW(&H42F) & ChrW(&H20) & ChrW(&H2665) & ChrW(&H222B))
Только вот нафига это тебе, никак не пойму?
Сейчас этот форум просматривают: SemrushBot и гости: 52