DEFINE CLASS Formix AS form titlebar = 0 ShowWindow = 2 nFlags = 0 alwaysonbottom = .f. alwaysontop = .T. eventi = .f. PROCEDURE Load Declare SetLayeredWindowAttributes in Win32Api as _Sol_SetLWA Integer, string,integer, integer Declare SetWindowLong in Win32Api as _Sol_SetWL Integer, Integer, Integer _Sol_SetWL(thisform.hWnd,-20, 0x00080000) _Sol_SetLWA(thisform.hwnd,0,255,2) ENDPROC Procedure init WITH Thisform .TitleBar = 1 .BackColor = Rgb(255,255,255) .BorderStyle= 0 .Caption = "" .Closable = .F. .ControlBox = .F. .icon = '' .clipcontrols = .f. .TitleBar = 0 EndWith EndProc Procedure KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl If nkeycode = 27 If this.eventi Clear Events Else Release thisform EndIf EndIf EndProc Procedure chgtrasp Parameters XVAL _sol_SetlWA(thisform.hwnd,0,XVAL,2) EndProc ENDDEFINEHere is the form I use to put the commandbuttons on.
DEFINE CLASS FormButt AS form activeclick = .f. ShowWindow = 2 nFlags = 0 Caption = "" Closable = .F. ControlBox = .F. * TitleBar = 0 backcolor = Rgb(255,0,255) alwaysontop = .t. eventi = .f. PROCEDURE Load DECLARE Long ReleaseCapture IN WIN32API DECLARE Long SendMessage IN WIN32API ; Long HWND, Long wMsg, Long wParam, Long Lparam ENDPROC PROCEDURE Init DECLARE INTEGER SetLayeredWindowAttributes IN win32api; INTEGER HWND, INTEGER crKey, INTEGER bAlpha, INTEGER dwFlags *These functions get and set a window's attributes DECLARE INTEGER SetWindowLong IN user32.DLL ; INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong DECLARE INTEGER GetWindowLong IN user32.DLL ; INTEGER hWnd, INTEGER nIndex WITH Thisform .Caption = "" .Closable = .F. .ControlBox = .F. .TitleBar = 0 .BackColor = RGB(255,0,255) .nFlags = 0 EndWith EndProc Procedure MakeTrasp This.Makeirregular(Thisform.HWnd,Thisform.BackColor) EndProc Procedure click If !this.activeclick Return EndIf this.Controls(1).click() EndProc PROCEDURE MakeIrregular ******************************************************************************** * To create a non-rectangular form, a transparent color needs to be set. * Anything drawn using this color will be transparent, and any * mouse clicks in these regions will pass through to the visible form. * * This technique only works in Windows 2000/XP but it is much more efficient * than previous techniques of setting a bounding region for the form. * * This can be used to create non-rectangluar forms, to create hovering agents, * or simply to confuse your coworkers <g>. * * Although this function makes a form transparent, the Form must be setup * accept these changes. First, the ShowWindow property MUST BE set to * 2 'As Top-Level Form'. Otherwise the window cannot be drawn layered. * Second, if you want to turn off the window's frame, since it will not be * drawn transparent, you can set the following properties: * BorderStyle = 0 * Caption = "" * Closable = .F. * ControlBox = .F. * TitleBar = 0 * ******************************************************************************** *-- Pass in the window handle (Thisform.HWIND) and the color to make transparent. LPARAMETERS nHWND, nColor *Constants for SetLayeredWindowAttributs #DEFINE LWA_COLORKEY 1 #DEFINE LWA_ALPHA 2 *Constants for SetWindowLong and GetWindowLong #DEFINE GWL_EXSTYLE -20 #DEFINE WS_EX_LAYERED 0x00080000 LOCAL lnFlags *The form's window must be set to Layered, so that it is drawn * in a separate layer. lnFlags = GetWindowLong(nHWND, GWL_EXSTYLE) &&Gets the existing flags from the window thisform.nFlags = lnFlags lnFlags = BITOR(lnFlags, WS_EX_LAYERED) &&Appends the Layered flag to the existing ones SetWindowLong(nHWND, GWL_EXSTYLE, lnFlags) &&Sets the new flags to the window SetLayeredWindowAttributes(nHWND, nColor, 0, LWA_COLORKEY) ENDPROC PROCEDURE Destroy CLEAR DLLS ENDPROC ENDDEFINEWhen I launch the application I got this error :