Une chose que je ne comprend pas vraiment. J’utilise un code comme suit (j’ai decouper pour que cela fontionne, il y a surement des variables non utiliser).
Code : Tout sélectionner
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
EnableExplicit
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
Enumeration
#Windows_0
EndEnumeration
Enumeration
#Gadget_0
#Gadget_1
EndEnumeration
Global stime.s = ""
UsePNGImageDecoder()
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
Procedure Draw_Screen()
;
If CreateImage(#Gadget_0, 551, 395)
If StartDrawing(ImageOutput(#Gadget_0))
DrawImage(ImageID(CatchImage(#PB_Any, ?maximenu01)), 0, 0)
DrawText(365, 176, "Mise à Jour : ", $00FFFF)
DrawText(455, 176, stime, $FFFFFF)
StopDrawing()
EndIf
SetGadgetState(#Gadget_0, ImageID(#Gadget_0))
FreeImage(#Gadget_0)
EndIf
EndProcedure
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
Define i.l
Define event.l
Define lTime.l
Define stemp.s
Define DefTread.l
Define TimeOut.l = (5 * 60) * 1000
If OpenWindow(#Windows_0, 0, 0, 561, 406, "test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWindowColor(#Windows_0, $008038)
ImageGadget(#Gadget_0, 5, 5, 551, 395, 0)
lTime = ElapsedMilliseconds()
Repeat
event = WaitWindowEvent(50)
If ElapsedMilliseconds() - lTime > TimeOut
; ENVOIS UNE ACTION
Else
stime = FormatDate("%hh:%ii:%ss", (TimeOut - (ElapsedMilliseconds() - lTime))/1000)
If stime <> stemp
stemp = stime
Draw_Screen()
EndIf
EndIf
Until event = #PB_Event_CloseWindow
EndIf
DataSection
maximenu01: IncludeBinary "includes\datas\background02.png"
EndDataSection
Code : Tout sélectionner
DrawImage(ImageID(CatchImage(#PB_Any, ?maximenu01)), 0, 0)
Cordialement,
GallyHC