Code : Tout sélectionner
Procedure switchcolor()
Dim lpaElements(0)
Dim lpaRgbValues(0)
lpaElements(0) = Random(30)
lpaRgbValues(0) = RGB(Random(255),Random(255),Random(255))
SetSysColors_(1,@lpaElements(),@lpaRgbValues(0))
EndProcedure
Repeat
Delay(10) ; VU LES RETOURS, METTRE LE TIMER A 1000 // Ar-S
switchcolor()
ForEver
Code : Tout sélectionner
UseGIFImageDecoder()
Declare exit()
Declare open()
Declare timer()
Declare events()
SystemParametersInfo_(#SPI_GETWORKAREA, 0, @DesktopRect.RECT, 0)
width = DesktopRect\right - DesktopRect\left - 186
height = DesktopRect\bottom - DesktopRect\top - 291
minwidth = DesktopRect\left
minheight = DesktopRect\top
Global img,Lastframe
If CatchImage(0,?img,?endimg-?img)
SetImageFrame(0,0)
window = OpenWindow(#PB_Any,0,0,ImageWidth(0),ImageHeight(0)+50,"NE PAS FERMER !!! ",#PB_Window_ScreenCentered|#PB_Window_BorderLess)
If window
text = TextGadget(#PB_Any,10,10,WindowWidth(window)-20,20,"On t'avais dit de ne pas cliquer !",#PB_Text_Center)
button = ButtonGadget(#PB_Any,WindowWidth(window)/2-10,WindowHeight(window) - 20,20,20,"Ok")
img = ImageGadget(#PB_Any,0,30,230,160,ImageID(0))
Lastframe = ImageFrameCount(0)
BindGadgetEvent(button,@exit())
BindEvent(#PB_Event_CloseWindow,@open())
AddWindowTimer(window,1,100)
BindEvent(#PB_Event_Timer,@timer())
EndIf
timer = ElapsedMilliseconds()
x1 = WindowWidth(window)/2-11
x2 = WindowWidth(window)/2+11
y1 = WindowHeight(window) - 21
y2 = WindowHeight(window)
Repeat
WaitWindowEvent()
If WindowMouseX(window) >= x1 And WindowMouseX(window) <= x2 And WindowMouseY(window) >= y1 And WindowMouseY(window) <= y2
ResizeWindow(window,Random(width,minwidth),Random(height,minheight),ImageWidth(0),ImageHeight(0)+50)
EndIf
ForEver
EndIf
Procedure exit()
End
EndProcedure
Procedure open()
RunProgram("NE PAS CLIQUER.exe")
EndProcedure
Procedure timer()
Static frame
frame + 1
If frame = Lastframe : frame = 0 : EndIf
SetImageFrame(0,frame)
SetGadgetState(img,ImageID(0))
EndProcedure
DataSection
img:
IncludeBinary "Loituma.gif"
endimg:
EndDataSection