>PUBLIC oform1 > >oform1=NEWOBJECT("form1") >oform1.Show >RETURN > > > ************************************************** >*-- Form: form1 (x:\foxv\hugo\prog\transparent.scx) >*-- ParentClass: form >*-- BaseClass: form >*-- Time Stamp: 05/10/07 09:09:08 AM >* >DEFINE CLASS form1 AS form > > > ShowWindow = 2 > DoCreate = .T. > Caption = "Form1" > BackColor = RGB(254,254,254) && changing to 255,255,255 will make the edit and text boxes transparents too > Name = "Form1" > > > ADD OBJECT command1 AS commandbutton WITH ; > Top = 218, ; > Left = 286, ; > Height = 27, ; > Width = 84, ; > Caption = "Exit", ; > Name = "Command1" > > > ADD OBJECT text1 AS textbox WITH ; > Height = 23, ; > Left = 17, ; > Top = 14, ; > Width = 126, ; > Name = "Text1" > > > ADD OBJECT edit1 AS editbox WITH ; > Height = 53, ; > Left = 17, ; > Top = 41, ; > Width = 124, ; > Name = "Edit1" > > > PROCEDURE Init > #DEFINE LWA_COLORKEY 1 > #DEFINE LWA_ALPHA 2 > #DEFINE GWL_EXSTYLE -20 > #DEFINE WS_EX_LAYERED 0x00080000 > > DECLARE INTEGER SetLayeredWindowAttributes IN win32api; > INTEGER HWND, INTEGER crKey, INTEGER bAlpha, INTEGER dwFlags > DECLARE INTEGER SetWindowLong IN user32.DLL ; > INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong > DECLARE INTEGER GetWindowLong IN user32.DLL ; > INTEGER hWnd, INTEGER nIndex > > local lnFlags > > lnFlags = BITOR(GetWindowLong(thisform.HWnd, GWL_EXSTYLE), WS_EX_LAYERED) > SetWindowLong(thisform.HWnd, GWL_EXSTYLE, lnFlags) > SetLayeredWindowAttributes(thisform.HWnd,thisform.backCOlor, 0, LWA_COLORKEY) > ENDPROC > > > PROCEDURE command1.Click > thisform.Release() > ENDPROC > > >ENDDEFINE >* >*-- EndDefine: form1 >************************************************** > >