Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Allows a timer function without the need for the V...
Author:
Duncan Jones
Submitted:
1/31/2001
Version:
VB5
Compatibility:
VB5, VB6
Category:
Windows API
Views:
10487
Allows a timer function without the need for the Visual basic "Timer" control. (Demonstrates callbacks and AddressOf) Full description of how this works is at: http://www.themestream.com/gspd_browse/browse/view_article.gsp?c_id=304506 By the same author: "7 Secrets of successful programmers" http://www.themestream.com/gspd_browse/browse/view_article.gsp?c_id=309847 Advanced VB: "Subclassing a window to prevent it being moved/resized" http://www.themestream.com/gspd_browse/browse/view_article.gsp?c_id=312441
Declarations:
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
Code:
Public Sub VB_TIMERPROC(ByVal hwnd As Long, ByVal uint1 As Long, ByVal nEventId As Long, ByVal dwParam As Long) On Error Resume Next '\\ Timer click processing End Sub '\\ On form load Dim lRet As Long lret = SetTimer(Me.hwnd, 1, 100, AddressOf VB_TIMERPROC) '\\ On form unload lret = KillTimer(Me.hwnd, 1)
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement