Kamis, 11 September 2008

Membuat Form Jadi Transparan (Visual Foxpro)

* Penulisanya
* 1. Ketik Di Form procedure - init
* : transparent(thisform.HWnd, thisform.BackColor)
* 2. buat background formnya : RGB(255,0,255)
* 3. ShowWindow=2
* 4. Ketik di Form procedure - unload
* CLEAR DLLS GetWindowLong,SetWindowLong,SetLayeredWindowAttributes
*------------------------------------------------------------------------
PROCEDURE transparenci
LPARAMETERS nHWND, nColor
DECLARE INTEGER GetWindowLong IN user32.DLL INTEGER hWnd, ;
INTEGER nIndex
DECLARE INTEGER SetWindowLong IN user32.DLL INTEGER hWnd, ;
INTEGER nIndex, ;
INTEGER dwNewLong
DECLARE INTEGER SetLayeredWindowAttributes IN WIN32API INTEGER HWND, ;
INTEGER crKey, ;
INTEGER bAlpha,;
INTEGER dwFlags
*********************************************************************************************
#DEFINE LWA_TRANSPARENT 1
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYERED 0x00080000

LOCAL lnFlags
*********************************************************************************************
lnFlags = GetWindowLong(nHWND, GWL_EXSTYLE) && Gets the existing flags from the window
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_TRANSPARENT)
ENDPROC
* HexToStr
*******************************************
Function HexToStr(cBytes)
Local cReturn,n
cReturn=""
For n=Len(cBytes)/2 to 1 step -1
nChr=eval("0x"+SubStr(cBytes,(n-1)*2+1,2))
cReturn=cReturn+chr(nChr)
endfor
Return cReturn
EndFunc

1 komentar:

Anonim mengatakan...

kaka listing'a ditaro dimana??saya g ngerti..maklum saya masih newbie..tolong pencerahannya

Mengenai Saya

Foto saya
Bekasi, Jawa Barat, Indonesia
eSoft Software product : - Dental Clinic system - General Ledger (Accounting System) - Manufacturing System - Trading system