i guess you are feel good. For me i would like to have your help.
Code: Select all
Enumeration
#Window_0
EndEnumeration
Enumeration
#StatusBar_Window_0
EndEnumeration
Enumeration
#ListIcon_0
EndEnumeration
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Global LastElem_
PBHeure$ = FormatDate("%hh:%ii:%ss", Date())
Procedure.s GetTimeString()
GetLocalTime_(@s.SYSTEMTIME)
Hour$ = Str(s\wHour)
Minute$ = Str(s\wMinute)
Second$ = Str(s\wSecond)
If Len(Hour$) = 1 : Hour$ = "0"+Hour$ : EndIf
If Len(Minute$) = 1 : Minute$ = "0"+Minute$ : EndIf
If Len(Second$) = 1 : Second$ = "0"+Second$ : EndIf
Time$ = Hour$+":"+Minute$+":"+Second$;+" "
ProcedureReturn Time$
EndProcedure
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 643, 30, 372, 288, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
If CreateStatusBar(#StatusBar_Window_0, WindowID(#Window_0))
EndIf
ListIconGadget(#ListIcon_0, 20, 25, 335, 215, "N°",100, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetColumn(#ListIcon_0, 1, "Time", 100)
AddGadgetItem(#ListIcon_0, -1, "1" + Chr(10)+"10:53:15")
AddGadgetItem(#ListIcon_0, 1, "2" + Chr(10)+"10:53:25")
AddGadgetItem(#ListIcon_0, 2, "3" + Chr(10)+"10:53:35")
AddGadgetItem(#ListIcon_0, 3, "4" + Chr(10)+"10:53:45")
AddGadgetItem(#ListIcon_0, 4, "5" + Chr(10)+"10:53:55")
EndIf
EndProcedure
Procedure GetTime_(Parameter)
LastElem_ = CountGadgetItems(#ListIcon_0) -1
Repeat
For ElemPosition_ = 0 To LastElem_
If GetGadgetItemText(#ListIcon_0,ElemPosition_,1) = GetTimeString()
Debug "Time mismatch"
Else
Debug "Time not found"
EndIf
;Debug GetGadgetItemText(#ListIcon_0,ElemPosition_,1)
;Debug GetTimeString()
Delay(1000)
Next
Until ElemPosition_ = 0
EndProcedure
OpenWindow_Window_0()
monthread = CreateThread(@ GetTime_(),255)
;If ElemPosition_ = -1
;KillThread(monthread)
;EndIf
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #ListIcon_0
EndIf
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
what i want to do is check and display "Time found" when the define time(5 times display in ListIcon) correspond to the system time
thanks in advance. have a good day !