Home > Software engineering >  The form of attachment can shadow by rectangular rounded corners?
The form of attachment can shadow by rectangular rounded corners?

Time:11-15


As shown,
The enclosed code:
 
'Create the shadow Windows Create shadow window
Private Sub CreateWindows ()
Const EX_STYLE As Long=WS_EX_LAYERED Or WS_EX_TRANSPARENT Or WS_EX_NOPARENTNOTIFY
HWndTt=CreateWindowExA (EX_STYLE, "# 32770", vbNullString, WS_POPUP, 0, 0, 0, 0, hWndForm, 0, Application. The hInstance, 0)
HWndBt=CreateWindowExA (EX_STYLE, "# 32770", vbNullString, WS_POPUP, 0, 0, 0, 0, hWndForm, 0, Application. The hInstance, 0)
HWndLt=CreateWindowExA (EX_STYLE, "# 32770", vbNullString, WS_POPUP, 0, 0, 0, 0, hWndForm, 0, Application. The hInstance, 0)
HWndRt=CreateWindowExA (EX_STYLE, "# 32770", vbNullString, WS_POPUP, 0, 0, 0, 0, hWndForm, 0, Application. The hInstance, 0)
MakeWindow
End Sub



'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

'Display the we create shadow
Private Sub DisplayShadows ()
If bIsLayered Then
If IsWindowVisible (hWndForm) & lt;> 0 Then
With wP
DisplayShadowSub, X, Y +., cY, cX + m_Depth + m_Depth, m_Depth, 1 'create shadow form (1)
DisplayShadowSub, X, Y +., cY, cX + m_Depth + m_Depth, m_Depth, 2 'create shadow form (2)
CX, DisplayShadowSub. + X., Y, m_Depth, cY, 3 'create shadow form (3 l)
CX, DisplayShadowSub. X +... Y, m_Depth, cY, 4 'create shadow form (4 r)
End With
End the If
End the If
End Sub

'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

'Display the content of the specified window rendering shadow shadow
Private Sub DisplayShadowSub (ByVal X As Long, ByVal Y As Long, cX As Long, cY As Long, ByVal sPosition As Integer)
Dim dc As Long
Dim iX As Long
Dim iY As Long
Dim hDib As Long
Dim hWin As Long
Dim nAlpha As Long
Dim aPixels () As Long
Dim pBmpBits As Long
Dim pt0 As tPOINT
Dim pt As tPOINT
Dim sz As tSIZE
Dim bs As tBLENDFUNCTION
Dim bmpHeader As tBITMAPINFOHEADER
Dim SafeArray As tSAFEARRAY2D
Dc CreateCompatibleDC (0) 'Get a screen compatible memory dc
With bmpHeader 'Initialize a bitmap header
. BiSize=Len (bmpHeader) 'Bitmap header size
.=cX 'biWidth Bitmap/window pixel width
.=cY 'biHeight Bitmap/window pixel height
. The biPlanes=1 'Graphics planes
.=32 'biBitCount 32 bits per pixel BGRA (Blue, Green, Red, Alpha)
. CY biSizeImage=cX * * 4 'Memory size, height width * * 32 bit
End With
HDib=CreateDIBSection (pBmpBits dc, bmpHeader, 0, 0, 0) 'Create a device independant bitmap as per the headers, compatible with the dc (compatible with the screen)
With the Construct a SafeArray 'VB SafeArray header that matches the specs of the bitmap
. CbElements=4 '4 bytes per element - 32 bits per pixel
CDims=2 'We' l l treat the pixels as a two dimensional array (x, y)
The pvData=https://bbs.csdn.net/topics/pBmpBits' The data pointer points to The bitmap data (pixels)
Bounds (0). LLbound=0 'Lowest bound will be 0
Bounds (0). The cElements=cY 'The number of elements
Bounds (1). The lLbound=0 'Lowest bound will be 0
Bounds (1). CElements cX '=The number of elements
End With
CopyMemory ByVal VarPtrArray (aPixels ()), VarPtr (SafeArray), 4 'Copy the address of our SafeArray over the address of aPixels () SafeArray


'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
The Select Case sPosition
Case 1 'shadow -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
HWin=hWndTt
For cX - iX=0 To 1
If iX & lt; CY Then
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • VBA
  • Related