VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

REAL Transparent RichTextBox

-cue-  (1 Submission)   Windows API Call/Explanation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

Create a real transparent RichTextBox with the standard Microsoft RichtextBox Control !!

Inputs
hWnd of the RichTextBox

Assumes
Put the : result = SetWindowLong(txtLogFile.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT) Function into a Event like FormLoad e.g. !!

Side Effects
Nothing

API Declarations
Const GWL_EXSTYLE = (-20)
Const WS_EX_TRANSPARENT = &H20&
Const WS_EX_LAYERED = &H80000
Const LWA_ALPHA = &H2&

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function AlphaBlend Lib "msimg32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal widthSrc As Long, ByVal heightSrc As Long, ByVal blendFunct As Long) As Boolean

Private Type BLENDFUNCTION
BlendOp As Byte
BlendFlags As Byte
SourceConstantAlpha As Byte
AlphaFormat As Byte
End Type
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Rate REAL Transparent RichTextBox (6(6 Vote))
REAL Transparent RichTextBox.bas

REAL Transparent RichTextBox Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters