En mode debug, il me met le code source de la page au moin 20 fois et je c pas pourquoi.
Code : Tout sélectionner
;/ Created with PureVisionXP v4.03
;- Global Variables and Constants
Global BubbleTipStyle.l:BubbleTipStyle=0
;- Window Constants
Enumeration 1
#Window_Form1
#Window_Form2
EndEnumeration
#WindowIndex=#PB_Compiler_EnumerationValue
;- Gadget Constants
Enumeration 1
;Window_Form1
#MenuBar_Form1_Fichier
#MenuBar_Form1_Quitter
#Gadget_Form1_Web2
;Window_Form2
#Gadget_Form2_Text4
#Gadget_Form2_Text5
#Gadget_Form2_Text6
#Gadget_Form2_Text7
#Gadget_Form2_Button8
EndEnumeration
#GadgetIndex=#PB_Compiler_EnumerationValue
;- MenuBar Constants
Enumeration 1
#MenuBar_Form1
EndEnumeration
#MenuBarIndex=#PB_Compiler_EnumerationValue
;- StatusBar Constants
Enumeration 1
#StatusBar_Form1
EndEnumeration
#StatusBarIndex=#PB_Compiler_EnumerationValue
#StatusBar_Form1_Field1 =0
#StatusBar_Form1_Field2 =1
ProcedureDLL.s Url2Text2(Url.s, OpenType.b,ProxyAndPort.s)
;/ Author : Pille
isLoop.b=1
INET_RELOAD.l = $80000000
hInet.l=0
hURL.l=0
Bytes.l=0
Buffer.s= Space (2048 )
RES.s= ""
hInet = InternetOpen_ ( "" , OpenType, ProxyAndPort, "" , 0)
hURL = InternetOpenUrl_ (hInet, Url, #Null , 0, INET_RELOAD, 0)
Repeat
InternetReadFile_ (hURL,@Buffer, Len (Buffer), @Bytes)
If Bytes = 0
isLoop=0
Else
RES = RES + Left (Buffer, Bytes)
EndIf
Until isLoop=0
InternetCloseHandle_ (hURL)
InternetCloseHandle_ (hInet)
ProcedureReturn RES
EndProcedure
ProcedureDLL.s Url2Text(Url.s)
ProcedureReturn Url2Text2(Url,1, "" )
EndProcedure
Procedure.l Window_Form1()
If OpenWindow(#Window_Form1,411,108,480,348,"Interventions en cours.",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_Invisible)
CreateMenu(#MenuBar_Form1,WindowID(#Window_Form1))
MenuTitle("Fichier")
MenuItem(#MenuBar_Form1_Quitter,"Quitter")
If CreateGadgetList(WindowID(#Window_Form1))
WebGadget(#Gadget_Form1_Web2,0,1,480,304,"http://www.sdis54.fr/interventions.php")
PVDynamic_AddStatusBar(#Window_Form1,#StatusBar_Form1,CreateStatusBar(#StatusBar_Form1,WindowID(#Window_Form1)),2)
AddStatusBarField(200)
AddStatusBarField(200)
PVDynamic_AddLockWindow(#Window_Form1,#StatusBar_Form1,1,3)
PVDynamic_AddGadget(#Window_Form1,#Gadget_Form1_Web2,3)
HideWindow(#Window_Form1,0)
ProcedureReturn WindowID(#Window_Form1)
EndIf
EndIf
EndProcedure
Procedure.l Window_Form2()
If OpenWindow(#Window_Form2,437,221,464,110,"Départ.",#PB_Window_ScreenCentered|#PB_Window_Invisible)
Brush.LOGBRUSH\lbColor=255
SetClassLong_(WindowID(#Window_Form2),#GCL_HBRBACKGROUND,CreateBrushIndirect_(Brush))
If CreateGadgetList(WindowID(#Window_Form2))
TextGadget(#Gadget_Form2_Text4,2,4,454,26,"Départ intervention Centre de Secours de BAYON.",#PB_Text_Center)
SetGadgetColor(#Gadget_Form2_Text4,#PB_Gadget_BackColor,255)
SetGadgetFont(#Gadget_Form2_Text4,LoadFont(#Gadget_Form2_Text4,"Georgia",14,0))
TextGadget(#Gadget_Form2_Text5,194,32,59,20,"à",#PB_Text_Center)
SetGadgetColor(#Gadget_Form2_Text5,#PB_Gadget_BackColor,255)
SetGadgetFont(#Gadget_Form2_Text5,LoadFont(#Gadget_Form2_Text5,"Georgia",12,0))
TextGadget(#Gadget_Form2_Text6,185,58,39,15,"Heure :")
SetGadgetColor(#Gadget_Form2_Text6,#PB_Gadget_BackColor,255)
TextGadget(#Gadget_Form2_Text7,221,58,60,15,"00h00",#PB_Text_Center)
SetGadgetColor(#Gadget_Form2_Text7,#PB_Gadget_BackColor,255)
ButtonGadget(#Gadget_Form2_Button8,2,83,461,21,"Quitter l'alarme")
HideWindow(#Window_Form2,0)
ProcedureReturn WindowID(#Window_Form2)
EndIf
EndIf
EndProcedure
Procedure WindowCallback(WindowID,Message,wParam,lParam)
ReturnValue=#PB_ProcessPureBasicEvents
If Message=#WM_GETMINMAXINFO
ReturnValue=PVDynamic_LockWindow(WindowID,lParam)
EndIf
If Message=#WM_SIZE
ReturnValue=PVDynamic_Resize(WindowID)
EndIf
If Message=#WM_CTLCOLORSTATIC Or Message=#WM_CTLCOLOREDIT Or Message=#WM_CTLCOLORLISTBOX
ReturnValue=PVDynamic_ColorGadget(lParam,wParam)
EndIf
ProcedureReturn ReturnValue
EndProcedure
Url$="http://www.sdis54.fr/interventions.php"
Source$=Url2Text(Url$)
;- Main Loop
If Window_Form1()
SetWindowCallback(@WindowCallback())
quitForm1=0
Repeat
EventID =WaitWindowEvent()
MenuID =EventMenu()
GadgetID =EventGadget()
WindowID =EventWindow()
Select EventID
Case #PB_Event_CloseWindow
If WindowID=#Window_Form1
quitForm1=1
EndIf
Case #PB_Event_Menu
Select MenuID
Case #MenuBar_Form1_Quitter
End
EndSelect
Case #PB_Event_Gadget
Select GadgetID
Case #Gadget_Form1_Web2
OpenFile(0, "SourceCode.txt")
FileSeek(0, Lof(0))
WriteString(0, Source$, #PB_Ascii)
CloseFile(0)
Debug Source$
EndSelect
EndSelect
Until quitForm1
CloseWindow(#Window_Form1)
EndIf
End