Cita de: LeandroA en 9 Febrero 2009, 18:48 PM
Hola este es con CreateWindowEx y utiliza WaitMessage para que el bucle no se coma el procesadorCódigo [Seleccionar]Option Explicit
Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Dim bEndLopp As Boolean
Dim Counter As Long
Sub main()
Dim mWnd As Long
mWnd = CreateWindowEx(0, "STATIC", "", 0, 0, 0, 0, 0, 0, 0, App.hInstance, 0&)
SetTimer mWnd, 0, 1000, AddressOf TimerProc
Do While bEndLopp = False
DoEvents
WaitMessage
Loop
KillTimer mWnd, 0
DestroyWindow mWnd
End Sub
Public Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
Counter = Counter + 1
Debug.Print Counter
If Counter = 10 Then
bEndLopp = True
End If
End Sub
o este ultimo esta genial gracias, aun que si te digo que me hubieras hecho pensar pero igual gracias.
Dulces Lunas