кто-нить использовал ее для создания формы прозрачной по цвету, т.е. dwFlags=LWA_COLORKEY?
там вторым параметром в функции идет ссыла на цвет COLORREF. я никак не могу найти, что это за colorref и как ссылку на него организовать.
Call SetLayeredWindowAttributes(Me.hWnd As Long, RGB(20,30,40), 128, LWA_COLORKEY)
alibek писал(а):
- Код: Выделить всё
Call SetLayeredWindowAttributes(Me.hWnd As Long, RGB(20,30,40), 128, LWA_COLORKEY)
Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
'В Generals:
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
Dim mMove As Boolean
Dim SX As Integer
Dim SY As Integer
'В форму:
Private Sub Form_Load()
Const TEXT = "Hi i am Virus!"
Dim hRgn As Long
Font.Name = "A"
Font.Bold = True
Font.Size = 55
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
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 20