|
Option Explicit
Private Const mcClassnameMSExcel = "XLMAIN"
Private m_strText As String
Private Declare Function KillTimer Lib "user32.dll" (ByVal hwnd _
As Long, ByVal nIDEvent As Long) As Long
Private Declare Function SetTimer Lib "user32.dll" (ByVal hwnd _
As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Private Declare Function FindWindow Lib "user32.dll" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Public Sub ShowDialogAPITimer()
Load frmAPITimerCaption
m_strText = frmAPITimerCaption.Caption
frmAPITimerCaption.Show
End Sub
Public Sub prcSetTimer()
SetTimer FindWindow(mcClassnameMSExcel, Application.Caption), _
0&, 100&, AddressOf prcTimer
End Sub
Private Sub prcTimer(ByVal hwnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long)
m_strText = Right$(m_strText, Len(m_strText) - 1) & _
Left$(m_strText, 1)
frmAPITimerCaption.Caption = m_strText
End Sub
Public Sub prcKillTimer()
KillTimer FindWindow(mcClassnameMSExcel, Application.Caption), 0&
End Sub
|
|