
The Win32 API includes a really amazing feature called region windows. A
window under Win32 no longer has to be rectangular! In fact, it can be any
shape that may be constructed using Win32 region functions. Using the
SetWindowRgn Win32 function from within VB is so simple, but the results
are unbelievable! The following example shows a VB form that is NOT
rectangular!!
Here is the code. Enjoy!
' This goes into the General Declarations section:
Private Declare Function CreateEllipticRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _
ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" _
(ByVal hWnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Sub Form_Load()
Show 'The form!
SetWindowRgn hWnd, _
CreateEllipticRgn(0, 0, 300, 200), _
True
End Sub
From-AlMoataz B. Ahmed, [AlMoataz_m@hotmail.com]

