KillTimer

Event ››
Parent Previous Next

KillTimer

Синтаксис

function KillTimer(hwnd as HWND, IDEvent as Uinteger) as Bool

Описание

Останавливает и удаляет таймер

Параметры

hwnd - хендл окна, за которым закреплен таймер

IDEvent - номер\идентификатор таймера

Платформы

Windows , Linux

Пример

#Include "window9.bi"
Dim As Integer event
Dim Shared As HWND hwnd
Function setText() As Integer
  Dim As String sz = "CAPTION"
  Static As Long i , j
  If i = 6 Then
     j = 1
  ElseIf i = 0 Then
     j = 0
  EndIf
  If j = 0 Then
     i+=1
  Else
     i-=1
  EndIf
  SetWindowText(hwnd,Left(sz,i+1))
  Return TRUE
End Function
hwnd = OpenWindow("",300,10,250,100)
ButtonGadget(1,10,10,150,30,"Отключить таймер")
SetTimer(hwnd,1,100,Cast(Any Ptr,@setText))
Do
  event=WaitEvent()
  If event=EventClose Then
     End
  ElseIf event = eventgadget Then
     KillTimer(hwnd,1)
  EndIf
Loop

Результат

Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator