Page 1 of 1

Support for GetLayeredWindowAttributes

Posted: Sat Aug 13, 2011 5:14 am
by MachineCode
Because PureBasic already supports SetLayeredWindowAttributes, but not getting them.

Re: Support for GetLayeredWindowAttributes

Posted: Tue Dec 10, 2019 8:03 am
by Mijikai
+1 still missing

Re: Support for GetLayeredWindowAttributes

Posted: Tue Dec 10, 2019 7:31 pm
by chi
It's probably faster to add missing API functions yourself... :oops:
  • copy user32.lib (from your desired WinSDK) to ".\PureBasic\PureLibraries\Windows\Libraries"
  • create an .imp file and copy it to ".\PureBasic\PureLibraries\Windows"
  • edit ".\PureBasic\Compilers\APIFunctionListing.txt" and add the function
Let me know if you need any help. I could write a more detailed tutorial ^^

Re: Support for GetLayeredWindowAttributes

Posted: Fri Dec 13, 2019 8:11 am
by RASHAD
Hi

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)



Re: Support for GetLayeredWindowAttributes

Posted: Fri Dec 13, 2019 2:43 pm
by chi
Hi

Code: Select all

GetLayeredWindowAttributes_(WindowID(0), @color, @alpha, @flags)

Debug color
Debug alpha
Debug flags