Here is a similar function I posted earlier today in an old topic(

) that may be useful for those interested in this kind of thing, so that they may expand upon it.
Rashad, have you tried SetWindowLongPtr() on windows XP? If so, does it work as it's supposed to?
(thread
here)
Code: Select all
;IncludeFile "C:\code\pb\include\WinAPI.pbi"
Declare OpenTransparentWindow(transColor.l, x.l, y.l, width.l, height.l, title.s, flag.l)
window = OpenTransparentWindow(RGB(255,254,253), 0, 0, 400, 400, "Invisible string gadget background", #PB_Window_SystemMenu)
StringGadget(0, 5, 5, 105, 23, "Test contents")
font = LoadFont(#PB_Any, "Arial", 12)
SetGadgetFont(0, FontID(font))
SetGadgetColor(0, #PB_Gadget_BackColor, RGB( 255,254, 253))
SetGadgetColor(0, #PB_Gadget_FrontColor, RGB( 255, 255, 255))
SetWindowColor(window, RGB(200,200,200))
HideWindow(window, 0)
While Not eventID = #PB_Event_CloseWindow
eventID = WaitWindowEvent(1)
Delay(10)
Wend
Procedure OpenTransparentWindow(transColor.l, x.l, y.l, width.l, height.l, title.s, flag.l) ;-- Create an invisible, borderless, and transparent window
; HideWindow(winResult, 0) after gadgets have been placed. Otherwise you may see flicker.
; I do not know if this works on all versions of windows or just Vista / 7
; I have only tested on both x86 and x64 Windows 7
winResult = OpenWindow(#PB_Any, 1, 1, 1, 1, title.s, #PB_Window_Invisible | flag.l)
SetWindowColor(winResult,transColor)
SetWindowLongPtr_(WindowID(winResult),#GWL_EXSTYLE, #WS_EX_LAYERED) ; -- According to the MSDN, this function will work with both x86 and x64 ( http://msdn.microsoft.com/en-us/library/ms644898(v=VS.85).aspx )
SetWindowPos_(WindowID(winResult),#Null, x, y, width, height, #Null) ; -- Must redraw window, according to the MSDN
SetLayeredWindowAttributes_(WindowID(winResult),transColor,#Null,#LWA_COLORKEY)
ProcedureReturn winResult
EndProcedure