forked from lee-soft/ViPad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LayerdWindowHandles.cls
78 lines (62 loc) · 1.68 KB
/
LayerdWindowHandles.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "LayerdWindowHandles"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public theDC As Long
Public oldBitmap As Long
Public mainBitmap As Long
Private winSize As win.SIZEL
Private srcPoint As win.POINTL
Private released As Boolean
Private m_myBlend As BLENDFUNCTION
Public Function Update(ByVal hWnd As Long, ByVal hdc As Long)
Call UpdateLayeredWindow(hWnd, hdc, ByVal 0&, winSize, theDC, srcPoint, 0, m_myBlend, ULW_ALPHA)
End Function
Public Function SetSize(newSize As win.SIZEL)
winSize = newSize
End Function
Public Function GetSize() As win.SIZEL
GetSize = winSize
End Function
Public Function SetPoint(newPoint As win.POINTL)
srcPoint = newPoint
End Function
Public Function GetPoint() As win.POINTL
GetPoint = srcPoint
End Function
Private Sub Class_Initialize()
With m_myBlend
.AlphaFormat = AC_SRC_ALPHA
.BlendFlags = 0
.BlendOp = AC_SRC_OVER
.SourceConstantAlpha = 255
End With
released = False
End Sub
Public Function SelectLayeredBitmap()
'SelectObject theDC, mainBitmap
End Function
Public Function SelectVBBitmap()
'SelectObject theDC, oldBitmap
End Function
Public Sub Release()
If released Then Exit Sub
released = True
SelectObject theDC, oldBitmap
DeleteObject mainBitmap
DeleteObject oldBitmap
DeleteDC theDC
End Sub
Private Sub Class_Terminate()
Release
End Sub