What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Timer from a form

Timer from a form
Author: Message:
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Timer from a form
quote:
Originally posted by Matty.
A do while loop with doevents in the middle :S

That doesn't sound good Matty...:P

Well, TheCodeSmith, search for APIs about SetTimer and callback functions ;)

For example...

code:
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
Public TimerEvent As Long


code:
TimerEvent = SetTimer(0, 0, 5000, AddressOf TimerProc_Process)    'Set a timer to fire after 5 seconds - it calls TimerProc_Process on firing


code:
Public Sub TimerProc_Process(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idEvent As Long, ByVal dwTime As Long)
    'Do something you want
End Sub


You need to kill the timer using this when you no longer needs it.
code:
KillTimer 0, TimerEvent


TimerProc_Process will be triggered every 5 seconds.

This post was edited on 07-11-2004 at 04:37 AM by Mnjul.
07-11-2004 04:27 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Timer from a form - by TheCodeSmith on 07-10-2004 at 08:32 PM
RE: Timer from a form - by dotNorma on 07-10-2004 at 08:53 PM
RE: Timer from a form - by Stigmata on 07-10-2004 at 08:54 PM
RE: Timer from a form - by Millenium_edition on 07-10-2004 at 10:53 PM
RE: Timer from a form - by TheCodeSmith on 07-11-2004 at 01:46 AM
RE: Timer from a form - by matty on 07-11-2004 at 02:14 AM
RE: Timer from a form - by TheCodeSmith on 07-11-2004 at 03:36 AM
RE: Timer from a form - by matty on 07-11-2004 at 04:01 AM
RE: Timer from a form - by Mnjul on 07-11-2004 at 04:27 AM
RE: Timer from a form - by TheCodeSmith on 07-11-2004 at 05:19 AM
RE: Timer from a form - by Mnjul on 07-11-2004 at 05:32 AM
RE: Timer from a form - by Mike on 07-11-2004 at 08:10 AM
RE: Timer from a form - by Stigmata on 07-11-2004 at 08:28 AM
RE: Timer from a form - by Millenium_edition on 07-11-2004 at 08:53 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On