Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make the form transparent??
Message
 
To
19/01/2002 10:56:39
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00607266
Message ID:
00607737
Views:
47
Hi,
In Windows 2000 and later you can use WinAPI function SetLayeredWindowAttributes :
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYERED 524288
#DEFINE LWA_COLORKEY 1
#DEFINE LWA_ALPHA    2

DECLARE INTEGER FindWindow IN WIN32API STRING, STRING
DECLARE LONG GetWindowLong IN WIN32API INTEGER, INTEGER
DECLARE LONG SetWindowLong IN WIN32API INTEGER, INTEGER, LONG
DECLARE SetLayeredWindowAttributes IN WIN32API INTEGER, INTEGER, INTEGER, LONG

* Getting a window handle
hWnd = FindWindow(NULL, 'Microsoft Visual FoxPro')
attr = GetWindowLong(hWnd, GWL_EXSTYLE)
SetWindowLong(hWnd, GWL_EXSTYLE, attr + WS_EX_LAYERED)

* To make the whole window semi-transparent:
Alpha = 192    && 0-255, 0 - transparent
SetLayeredWindowAttributes(hWnd, 0, Alpha, LWA_ALPHA)

* To make a selected color transparent:
*Color = RGB(255,255,255)
*SetLayeredWindowAttributes(hWnd, Color, 0, LWA_COLORKEY)
Previous
Reply
Map
View

Click here to load this message in the networking platform