>Too bad you need to have a caption on the form for it to work.
Eric is right off corse (as always :-)
Try this:
------------Form.Load
LOCAL INTEGER hr
DECLARE INTEGER CreateEllipticRgn IN gdi32 INTEGER X1 , INTEGER Y1 , INTEGER X2 , INTEGER Y2
DECLARE INTEGER SetWindowRgn IN user32 INTEGER HWND, INTEGER hRgn , INTEGER bRedraw
SET LIBR TO ( HOME()+'foxtools.fll' )
WITH THIS
.Caption = "just a caption to find"
.Movable = .T.
lnwhandle = _WFindTitl(.Caption)
HWND = _WhToHWnd(lnwhandle)
.Caption = ""
.Movable = .F.
.AutoCenter = .T.
hr = CreateEllipticRgn(0, 0, .Width, .Height)
SetWindowRgn(HWND, hr, 1)
.AddObject('s','Shape')
ENDWITH
WITH THIS.s
.Left=-1
.Top=-1
.Width=THIS.Width-4
.Height=THIS.Height-4
.Curvature = 99
.BorderWidth=3
.BorderColor=RGB(128,128,128)
.ZOrder(1)
.Visible = .T.
ENDWITH
LOCAL INTEGER hr
DECLARE INTEGER CreateEllipticRgn IN gdi32 INTEGER X1 , INTEGER Y1 , INTEGER X2 , INTEGER Y2
DECLARE INTEGER SetWindowRgn IN user32 INTEGER HWND, INTEGER hRgn , INTEGER bRedraw
SET LIBR TO ( HOME()+'foxtools.fll' )
WITH THIS
.Caption = "just a caption to find"
.Movable = .T.
lnwhandle = _WFindTitl(.Caption)
HWND = _WhToHWnd(lnwhandle)
.Caption = ""
.Movable = .F.
.AutoCenter = .T.
hr = CreateEllipticRgn(0, 0, .Width, .Height)
SetWindowRgn(HWND, hr, 1)
.AddObject('s','Shape')
ENDWITH
WITH THIS.s
.Left=-1
.Top=-1
.Width=THIS.Width-4
.Height=THIS.Height-4
.Curvature = 99
.BorderWidth=3
.BorderColor=RGB(128,128,128)
.ZOrder(1)
.Visible = .T.
ENDWITH
----------------------
You may also add a 3D bmp background (something like Norton SafeGuard!)
For me, I use that in the Splash screen!
Also if anyone interested :
there is another neat API function but couldn't get it to work:
HRGN CreatePolygonRgn(
CONST POINT *lppt, // pointer to array of points
int cPoints, // number of points in array
int fnPolyFillMode // polygon-filling mode
)
HRGN : Integer
int : Integer
POINT :
struct{
LONG x;
LONG y;
} POINT
LONG : Integer
POINT * : pointer to an array of POINT structure
it'll be very nice if someone out there do some more investigations and come out with a FancySplach class that can be of any shape, i would if i only have the time.
Waleed
To VB or not to VB that's the question!
(I'll VFP :-)