[SOLVED] Transparent Window
Posted: Sun Feb 06, 2011 4:32 am
Does anybody know how to set the window background color to be TRANSPARENT?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
#WIN = 0
Procedure ShowWin()
;-------------------
If OpenWindow(#WIN, 0, 0, 300, 300, "Transparent Window",#PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
SetWindowColor(#WIN,#Blue)
SetWindowLong_(WindowID(#WIN), #GWL_EXSTYLE, #WS_EX_LAYERED | #WS_EX_TOPMOST)
SetLayeredWindowAttributes_(WindowID(#WIN),#Blue,0,#LWA_COLORKEY)
EndIf
EndProcedure
ShowWin()
Repeat
iEvent.i = WaitWindowEvent(1)
Until iEvent = #PB_Event_CloseWindow
End
You can try creating a hidden window, creating your gadgets and then unhiding the window.Primus wrote:I'm using a code like that to create a transparent window, but I encountered a problem:
When hiding and un-hiding gadgets, the desktop shines through for the glimpse of a second.
It's just a short flash, but with a sufficient amount of gadgets, it becomes annoying. Besides, it doesn't look exactly professional if parts of your software suddenly disappear without an apparent reason![]()
I already tried SmartWindowRefresh, but it doesn't do the trick.
Now, I know that hiding requires to redraw the window, but isn't there a way to do it without the abovementioned effect? For example, isn't it possible to create an additional layer which is excluded from the refreshing process?