Quantcast
Channel: SCN: Message List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 7329

Re: Transparent Window in PB

$
0
0

This feature seems to be broken ... you need some API Voodoo magic


Code for PB 12.5:

External Function Declaration:

Functionlong GetWindowLong (ulong hWnd, int nIndex) Library"user32.dll"Aliasfor"GetWindowLongW"

Functionlong SetWindowLong (ulong hWnd, int nIndex, long dwNewLong) Library"user32.dll"Aliasfor"SetWindowLongW"

FunctionLong SetLayeredWindowAttributes(ulong hWnd, Long crKey , byte bAlpha , Long dwFlags) Library"user32.dll"


Open () Event Script in Window:


Constantlong  LWA_COLORKEY = 1

Constantlong  GWL_EXSTYLE = -20

Constantlong  WS_EX_LAYERED = Long(2^19)

 

SetWindowLong ( Handle(this), GWL_EXSTYLE, &

     GetWindowLong( Handle (this), GWL_EXSTYLE ) + WS_EX_LAYERED)

 

// Make "background" colored pixels transparent

SetLayeredWindowAttributes(Handle(this), This.BackColor , BYTE(0), LWA_COLORKEY)

 

hth

 

Arnd


Viewing all articles
Browse latest Browse all 7329


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>