How i can do that so window is full transparent but gadgets are not
Karu
Transparent window in pb4
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
This'll work, I supplied methods to move and close the window, but you're certainly free to use your own imagination to accomplish those tasks:
If you're going to put image gadget(s) on there to make a skin, remember to disable them so they aren't firing events.
For Win 9x you can use region clipping to accomplish a similar result but it's more work.
Code: Select all
OpenWindow(0,0,0,320,240,"",#PB_Window_ScreenCentered|#PB_Window_BorderLess)
SetWindowLong_(WindowID(0),#GWL_EXSTYLE,GetWindowLong_(WindowID(0),#GWL_EXSTYLE)|#WS_EX_LAYERED)
SetLayeredWindowAttributes_(WindowID(0),RGB(255,0,255),0,#LWA_COLORKEY)
SetWindowColor(0,RGB(255,0,255))
CreateGadgetList(WindowID(0))
ButtonGadget(0,300,0,20,20,"X")
StickyWindow(0,1)
CreateImage(0,32,32)
StartDrawing(ImageOutput(0))
Box(0,0,32,32,RGB(255,0,255))
Box(12,0,6,32,0)
Box(0,12,32,6,0)
StopDrawing()
ImageGadget(1,0,0,0,0,ImageID(0))
DisableGadget(1,1)
quit = 0
Repeat
ev = WaitWindowEvent()
Select ev
Case #WM_LBUTTONDOWN
SendMessage_(WindowID(0),#WM_NCLBUTTONDOWN,#HTCAPTION,0)
Case #PB_Event_Gadget
If EventGadget()=0
quit = 1
EndIf
EndSelect
Until quit
For Win 9x you can use region clipping to accomplish a similar result but it's more work.
BERESHEIT
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Code: Select all
SendMessage_(WindowID(0),#WM_NCLBUTTONDOWN,#HTCAPTION,0)
This nifty thang' is a enormous time/life saver, thanks netmaestro!
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?