Tu peux (window only) créer une fenêtre transparente et y dessiner par exemple du texte ou un image png, mon exemple est avec du texte en rouge, la couleur noir est transparente
Code : Tout sélectionner
Enumeration Img
#Icone
EndEnumeration
Enumeration Font
#InfoFont
EndEnumeration
Enumeration Form
#MainForm
#InfoForm
#InfoCanvas
#MainSysTray
#MainBtPlay
#MainBtStop
#MainBtPause
EndEnumeration
LoadFont(#InfoFont,"Arial",36,#PB_Font_HighQuality)
Global gStatus.b=#False
Declare OpenInfo()
Procedure EventBtPlay()
Debug "Event Play"
EndProcedure
Procedure EventBtStop()
Debug "Event Stop"
EndProcedure
Procedure EventBtPause()
Debug "Event Stop"
EndProcedure
Procedure EventMainForm()
Select gStatus
Case #True
HideWindow(#MainForm,#True)
CloseWindow(#InfoForm)
gStatus=#False
Case #False
HideWindow(#MainForm,#False)
OpenInfo()
gStatus=#True
EndSelect
EndProcedure
Procedure OpenInfo()
OpenWindow(#InfoForm,400,400,200,200,"",#PB_Window_BorderLess)
SetWindowLong_(WindowID(#InfoForm), #GWL_EXSTYLE, #WS_EX_LAYERED)
SetLayeredWindowAttributes_(WindowID(#InfoForm), RGB(0,0,0), 0, #LWA_COLORKEY)
CanvasGadget(#InfoCanvas,0,0,WindowWidth(#InfoForm),WindowHeight(#InfoForm))
StartDrawing(CanvasOutput(#InfoCanvas))
Box(0,0,GadgetWidth(#InfoCanvas),GadgetHeight(#InfoCanvas),RGB(0,0,0))
DrawingFont(FontID(#InfoFont))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(30,30,"Teste",RGB(255,0,0))
StopDrawing()
EndProcedure
Procedure OpenMainForm()
Protected Flag=#PB_Window_TitleBar|#PB_Window_Tool|#PB_Window_ScreenCentered
Protected M=10,X=M,Y=M,H=30,W=60
LoadImage(#Icone,"make.ico")
OpenWindow(#MainForm,0,0,300,150,"SherPlay",Flag)
AddSysTrayIcon(#MainSysTray,WindowID(#MainForm),ImageID(#Icone))
gStatus=#True
ButtonGadget(#MainBtPlay,X,Y,W,H,"Play")
X+M+W
ButtonGadget(#MainBtStop,X,Y,W,H,"Stop")
X+M+W
ButtonGadget(#MainBtPause,X,Y,W,H,"Pause")
BindGadgetEvent(#MainBtPlay,@EventBtPlay())
BindGadgetEvent(#MainBtStop,@EventBtStop())
BindGadgetEvent(#MainBtPause,@EventBtPause())
BindEvent(#PB_Event_SysTray,@EventMainForm(),#MainForm)
OpenInfo()
EndProcedure
OpenMainForm()
Repeat:WaitWindowEvent():ForEver