Support for GetLayeredWindowAttributes
Posted: Sat Aug 13, 2011 5:14 am
Because PureBasic already supports SetLayeredWindowAttributes, but not getting them.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Prototype LayeredWindowAttributes(a,b,c,d)
OpenLibrary(0, "user32.dll")
Global GetLayeredWindowAttributes_.LayeredWindowAttributes = GetFunction(0, "GetLayeredWindowAttributes")
OpenWindow(0,0,0,640,480,"",#PB_Window_ScreenCentered| #PB_Window_SystemMenu)
SetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE, GetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE) | #WS_EX_LAYERED)
SetLayeredWindowAttributes_(WindowID(0), $0000FF, 128, #LWA_ALPHA)
GetLayeredWindowAttributes_(WindowID(0), @color, @alpha, #LWA_ALPHA)
;GetLayeredWindowAttributes_(WindowID(0), @color, @alpha, #LWA_COLORKEY)
Debug color
Debug alpha
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_Event_CloseWindow
CloseLibrary(0)
Code: Select all
GetLayeredWindowAttributes_(WindowID(0), @color, @alpha, @flags)
Debug color
Debug alpha
Debug flags